double abs (double x); float abs (float x);long double abs (long double x);
double abs (double x); float abs (float x);long double abs (long double x); double abs (T x); // additional overloads for integral types
int
类型的值进行操作)。<cmath>
) 为整型提供了额外的重载:这些重载在计算前有效地将 x 转换为 double
(定义为 T 是任何整型)。
|
|
abs (3.1416) = 3.1416 abs (-10.6) = 10.6 |