Export (0) Print
Expand All
div
Expand Minimize
2 out of 2 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 
);

Parameter

x
Floating-point value.

Return Value

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

Input SEH Exception Matherr Exception
± QNAN,IND none _DOMAIN

Remarks

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

Requirements

Function Required header Compatibility
fabs, fabsf <math.h> ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

Example

See the example for abs.

See Also

Floating-Point Support Routines | abs | _cabs | labs | Run-Time Routines and .NET Framework Equivalents

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.