| Types and the imaginary constant | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
| Manipulation | |||||||||||||||||||||||||||||||
| Power and exponential functions | |||||||||||||||||||||||||||||||
| Trigonometric functions | |||||||||||||||||||||||||||||||
| Hyperbolic functions | |||||||||||||||||||||||||||||||
Defined in header <complex.h> | ||
float cabsf(floatcomplex z); | (1) | (since C99) |
double cabs(doublecomplex z); | (2) | (since C99) |
longdouble cabsl(longdoublecomplex z); | (3) | (since C99) |
Defined in header <tgmath.h> | ||
#define fabs( z ) | (4) | (since C99) |
z.z has typelongdoublecomplex orlongdoubleimaginary,cabsl is called. Ifz has typefloatcomplex orfloatimaginary,cabsf is called. Ifz has typedoublecomplex ordoubleimaginary,cabs is called. For real and integer types, the corresponding version offabs is called.Contents |
| z | - | complex argument |
If no errors occur, returns the absolute value (norm, magnitude) ofz.
Errors and special cases are handled as if the function is implemented ashypot(creal(z),cimag(z))
Output:
1.0+1.0i cartesian is rho=1.414214 theta=0.785398 polar
(C99)(C99)(C99) | computes the phase angle of a complex number (function)[edit] |
(C99) | computes absolute value of an integral value (\(\small{|x|}\)|x|) (function)[edit] |
(C99)(C99) | computes absolute value of a floating-point value (\(\small{|x|}\)|x|) (function)[edit] |
(C99)(C99)(C99) | computes square root of the sum of the squares of two given numbers (\(\scriptsize{\sqrt{x^2+y^2} }\)√x2 +y2 ) (function)[edit] |
C++ documentation forabs | |