2 /* @(#)s_fabs.c 5.1 93/09/24 */
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7 * Developed at SunPro, a Sun Microsystems, Inc. business.
8 * Permission to use, copy, modify, and distribute this
9 * software is freely granted, provided that this notice
11 * ====================================================
16 <<fabs>>, <<fabsf>>---absolute value (magnitude)
24 double fabs(double <[x]>);
25 float fabsf(float <[x]>);
36 <<fabs>> and <<fabsf>> calculate
40 the absolute value (magnitude) of the argument <[x]>, by direct
41 manipulation of the bit representation of <[x]>.
44 The calculated value is returned. No errors are detected.
48 <<fabsf>> is an extension.
53 * fabs(x) returns the absolute value of x.
58 #ifndef _DOUBLE_IS_32BITS
68 GET_HIGH_WORD(high
,x
);
69 SET_HIGH_WORD(x
,high
&0x7fffffff);
73 #endif /* _DOUBLE_IS_32BITS */