函数名: cabs(_cabs)
程序示例
#include <stdio.h>
#include <math.h>
int main(void)
double val;
z.x = 2.0;
z.y = 1.0;
val = cabs(z);
printf("The absolute value of %.2lfi %.2lfj is %.2lf", z.x, z.y, val); return 0; }
下面的例子来自MSDN[1]
#include <math.h>
#include <stdio.h>
int main( void )
{ struct _complex number = { 3.0, 4.0 };
double d;
printf( "The absolute value of %f + %fi is %f\n",number.x, number.y, d);
}