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]>);
26 <<fabs>> and <<fabsf>> calculate
30 the absolute value (magnitude) of the argument <[x]>, by direct
31 manipulation of the bit representation of <[x]>.
34 The calculated value is returned.
38 <<fabsf>> is an extension.
42 /******************************************************************
43 * Floating-Point Absolute Value
46 * x - floating-point number
52 * fabs computes the absolute value of a floating point number.
54 *****************************************************************/
59 #ifndef _DOUBLE_IS_32BITS
62 _DEFUN (fabs, (double),
76 return (x < 0.0 ? -x : x);
80 #endif /* _DOUBLE_IS_32BITS */