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

From cppreference.com
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 );
double      fabs( Integral arg );
(since C++11)

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

computes absolute value of an integral value (|x|)
(function) [edit]
(C++11)
checks if the given number is negative
(function) [edit]
returns the magnitude of a complex number
(function template) [edit]
applies the function std::abs to each element of valarray
(function template) [edit]

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages