C语言中的取绝对值函数

abs() 是用来求整型表达式的绝对值
fabs() 是用来求浮点型表达式的绝对值
#include<math.h>
int型
int abs(int x);

long 型
long labs(int x);

浮点数 float double
double fabs(double x);

猜你喜欢

转载自blog.csdn.net/qq_43361844/article/details/87297440
今日推荐