xref: /freebsd/lib/msun/src/s_fabs.c (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
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 /*
13  * fabs(x) returns the absolute value of x.
14  */
15 
16 #include "math.h"
17 #include "math_private.h"
18 
19 double
20 fabs(double x)
21 {
22 	u_int32_t high;
23 	GET_HIGH_WORD(high,x);
24 	SET_HIGH_WORD(x,high&0x7fffffff);
25         return x;
26 }
27