|
absfunction
<cstdlib>
int abs ( int n ); long abs ( long n ); Absolute value Returns the absolute value of parameter n ( /n/ ).In C++, this function is overloaded in <cmath> for floating-point types (see cmath abs), in <complex> for complex numbers (see complex abs), and in <valarray> for valarrays (see valarray abs). Parameters
Return ValueThe absolute value of n.PortabilityIn C, only the int version exists.Example
Output:
See also
|