C++取绝对值

添加头函数

#include<cmath>

对于整数:

int abs(int i)

对于浮点数:

double fabs(double i)
float fabs(float i)

C++11标准

double abs (double x);

float abs (float x);

long double abs (long double x);

double abs (T x);

猜你喜欢

转载自www.cnblogs.com/blink-cz/p/12357948.html