std::abs(float), std::fabs

From Cppreference

Jump to: navigation, search
Defined in header <cmath>

float       abs( float arg );

double      abs( double arg );

long double abs( long double arg );

float       fabs( float arg );

double      fabs( double arg );

long double fabs( long double arg );

Computes the absolute value of a floating point value arg.

[edit] Parameters

arg - floating point value

[edit] Return value

the absolute value of arg (|arg|)

[edit] See also

abs(int)
labs
llabs
computes absolute value of an integral value (|x|)
(function)
signbit (C++11)
checks if the given number is negative
(function)