xref: /freebsd/lib/msun/src/s_fabs.c (revision d2033021a73db7b8d910c1ffc52f4d1d0def7162)
1 /*
2  * ====================================================
3  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
4  *
5  * Developed at SunPro, a Sun Microsystems, Inc. business.
6  * Permission to use, copy, modify, and distribute this
7  * software is freely granted, provided that this notice
8  * is preserved.
9  * ====================================================
10  */
11 
12 #include <sys/cdefs.h>
13 /*
14  * fabs(x) returns the absolute value of x.
15  */
16 
17 #include "math.h"
18 #include "math_private.h"
19 
20 double
21 fabs(double x)
22 {
23 	u_int32_t high;
24 	GET_HIGH_WORD(high,x);
25 	SET_HIGH_WORD(x,high&0x7fffffff);
26         return x;
27 }
28