fabs.3m (2010 09)

f
fabs(3M) fabs(3M)
NAME
fabs( ), fabsf( ), fabsl( ), fabsw( ), fabsq( ) - absolute value functions
SYNOPSIS
#include <math.h>
double fabs(double x);
float fabsf(float x);
HP Integrity Server Only
long double fabsl(long double x);
extended fabsw(extended x);
quad fabsq(quad x);
DESCRIPTION
The fabs() function returns the absolute value of x,|x|.
fabsf() is a float version of fabs(); it takes a
float argument and returns a float result.
Integrity Server Only
fabsl() is a long double version of fabs(); it takes a long double argument and returns a
long double result.
fabsw() is an extended version of fabs(); it takes an extended argument and returns an
extended result.
fabsq() is equivalent to fabsl() on HP-UX systems.
USAGE
To use
fabsf(), compile either with the default -Ae option or with the -Aa
option. For PA-RISC only,
the
-D_HPUX_SOURCE option must be used along with the
-Aa option.
To use (for Integrity servers)
fabsl(), fabsw(),orfabsq(), compile either with the default
-Ae
option or with the -Aa and -D_HPUX_SOURCE
options. To use fabsw() or fabsq(), compile with the
-fpwidetypes option.
To use these functions, make sure your program includes
<math.h>, and link in the math library by
specifying -lm on the compiler or linker command line.
For more information, see the HP-UX floating-point guide for HP Integrity servers at the following site:
http://www.hp.com/go/fp
.
RETURN VALUE
If x is ±INFINITY,
fabs() returns +INFINITY.
If x is NaN,
fabs() returns NaN.
These functions raise no exceptions.
ERRORS
No errors are defined.
SEE ALSO
abs(3C), cabs(3M), ceil(3M), floor(3M), fmod(3M), rint(3M), math(5).
STANDARDS CONFORMANCE
fabs() : SVID3, XPG4.2, ANSI C, ISO/IEC C99 (including Annex F, "IEC 60559 floating-point arith-
metic")
fabsf(), fabsl() : ISO/IEC C99 (including Annex F, "IEC 60559 floating-point arithmetic")
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)