xref: /freebsd/lib/msun/src/s_fabs.c (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
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