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);
posted @ 2020-02-24 17:49  等一城烟雨  阅读(5408)  评论(0)    收藏  举报