Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <math.h> double cabs(_ _complex z);
|
Return val. |
i.e. the absolute value of the complex number z. In the case of an overflow, the program aborts (signal SIGFPE)! |
Example | The following program calculates the absolute value of a complex number. #include <stdio.h> #include <math.h> int main(void) { __complex z; if (scanf("%f %f", &z.x, &z.y) == 2) printf("%f : Absolute value\n", cabs(z)); return 0; } |
See also | abs, fabs, labs, llabs, sqrt |