Returns the absolute value of a complex number. Format #include <math.h> double cabs (cabs_t z); float cabsf (cabsf_t z); (Integrity servers, Alpha) long double cabsl (cabsl_t z); (Integrity servers, Alpha)
1 – Argument
z A structure of type cabs_t, cabsf_t, or cabsl_t. These types are defined in the <math.h> header file as follows: typedef struct {double x,y;} cabs_t; typedef struct { float x, y; } cabsf_t; (Integrity servers, Alpha) typedef struct { long double x, y; } cabsl_t; (Integrity servers, Alpha)
2 – Description
The cabs functions return the absolute value of a complex number by computing the Euclidean distance between its two points as the square root of their respective squares: sqrt(x2 + y2) On overflow, the return value is undefined. The cabs, cabsf, and cabsl functions are equivalent to the hypot, hypotf, and hypotl functions, respectively.