Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
fabs, fabsf
and
div
eof
not
or
xor
Collapse the table of content
Expand the table of content

fabs, fabsf

Calculates the absolute value of the floating-point argument.

double fabs( 
   double x 
);
float fabs(
   float x 
); // C++ only
long double fabs(
   long double x
); // C++ only
float fabsf( 
   float x 
);

x

Floating-point value.

fabs returns the absolute value of its argument. There is no error return.

Input

SEH Exception

Matherr Exception

± QNAN,IND

none

_DOMAIN

C++ allows overloading, so you can call overloads of fabs. In a C program, fabs always takes and returns a double.

Function

Required header

fabs , fabsf

<math.h>

For additional compatibility information, see Compatibility in the Introduction.

See the example for abs.

Show:
© 2015 Microsoft