Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 15:43, 1 July 2013 by P12bot (Talk | contribs)

 
 
 
Common mathematical functions
Functions
Basic operations
abs(float)fabs
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Exponential functions
(C++11)
(C++11)
(C++11)
(C++11)
Power functions
(C++11)
(C++11)
Trigonometric and hyperbolic functions
(C++11)
(C++11)
(C++11)
Error and gamma functions
(C++11)
(C++11)
(C++11)
(C++11)
Nearest integer floating point operations
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Floating point manipulation functions
(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)
Classification/Comparison
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Macro constants
(C++11)(C++11)(C++11)(C++11)(C++11)
 
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.

Parameters

arg - floating point value

Return value

the absolute value of arg (|arg|)

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]