2015-05-05 Yvan Roux <yvan.roux@linaro.org>
[official-gcc.git] / libjava / classpath / native / fdlibm / s_fabs.c
blob510c5a88493da672a252fd2d1ce5d34bc39115db
2 /* @(#)s_fabs.c 1.3 95/01/18 */
3 /*
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7 * Developed at SunSoft, a Sun Microsystems, Inc. business.
8 * Permission to use, copy, modify, and distribute this
9 * software is freely granted, provided that this notice
10 * is preserved.
11 * ====================================================
15 * fabs(x) returns the absolute value of x.
18 #include "fdlibm.h"
20 #ifndef _DOUBLE_IS_32BITS
22 #ifdef __STDC__
23 double fabs(double x)
24 #else
25 double fabs(x)
26 double x;
27 #endif
29 uint32_t hx;
31 GET_HIGH_WORD(hx,x);
32 SET_HIGH_WORD(x, hx & 0x7fffffff);
33 return x;
36 #endif /* _DOUBLE_IS_32BITS */