函数名: cabs
功 能: 计算复数的绝对值
用 法: #include <math.h>
double cabs(struct complex z);
程序例:
#include <stdio.h>
#include <math.h>
int main(void)
{
struct complex z;
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;
}