]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/msun/src/s_fabs.c
pow,powf(3),__ieee754_rem_pio2(f): Avoid negative integer left shift UB
[FreeBSD/FreeBSD.git] / lib / msun / src / s_fabs.c
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 }