##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

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

From cppreference.com
< cpp‎ | numeric‎ | math

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 | - | Value of a floating-point or Integral type

### [edit] Return value

The absolute value of `arg` (`|arg|`).

### [edit] See also

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

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/numeric/math/fabs&oldid=67115"