fabs [C++ Reference]
Keywords: c,math,fabs
Date: 2009-03-20T00:02:04-0700

[[fabs]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## fabs

Syntax:

        #include <cmath>
        double fabs( double arg );

The function fabs() returns the absolute value of arg.

C++ also provides the following overloaded forms:

        #include <cmath>
        float fabs( float arg ); // same as fabsf() in C99
        long double fabs( long double arg ); // same as fabsl() in C99

You can also use abs() instead of fabs() in C++, as it contains overloaded versions for it.

Related Topics: abs, fmod, labs

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •