2 /* @(#)z_fabs.c 1.0 98/08/13 */
6 <<fabs>>, <<fabsf>>---absolute value (magnitude)
14 double fabs(double <[x]>);
15 float fabsf(float <[x]>);
18 <<fabs>> and <<fabsf>> calculate
22 the absolute value (magnitude) of the argument <[x]>, by direct
23 manipulation of the bit representation of <[x]>.
26 The calculated value is returned.
30 <<fabsf>> is an extension.
34 /******************************************************************
35 * Floating-Point Absolute Value
38 * x - floating-point number
44 * fabs computes the absolute value of a floating point number.
46 *****************************************************************/
51 #ifndef _DOUBLE_IS_32BITS
67 return (x
< 0.0 ? -x
: x
);
71 #endif /* _DOUBLE_IS_32BITS */