Export (0) Print
Expand All
div
eof
Expand Minimize
3 out of 4 rated this helpful - Rate this topic

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 
);

Parameters

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 Compatibility

fabs, fabsf

<math.h>

ANSI, Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003

For additional compatibility information, see Compatibility in the Introduction.

See the example for abs.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.