(1)abs()是对整数取绝对值, 而fabs()是对浮点数取绝对值。
(2)函数原型:
int abs(int x)
double fabs(double x)
(3)头文件:
abs(): #include <stdlib.h>
fabs(): #include <math.h>
(1)abs()是对整数取绝对值, 而fabs()是对浮点数取绝对值。
(2)函数原型:
int abs(int x)
double fabs(double x)
(3)头文件:
abs(): #include <stdlib.h>
fabs(): #include <math.h>