summaryrefslogtreecommitdiffstats
path: root/newlib/libm/common/sf_cbrt.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2001-04-04 13:33:01 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2001-04-04 13:33:01 +0000
commit16740220a22d09a1c63714d93f1efc5fbe3927f3 (patch)
tree7b24242b9b20a0ee328c94acd2c95e1a8778c944 /newlib/libm/common/sf_cbrt.c
parent51fc3813e9a9ef8079b2fbde1b12647dd3f4ac93 (diff)
downloadcygnal-16740220a22d09a1c63714d93f1efc5fbe3927f3.tar.gz
cygnal-16740220a22d09a1c63714d93f1efc5fbe3927f3.tar.bz2
cygnal-16740220a22d09a1c63714d93f1efc5fbe3927f3.zip
* libc/include/machine/ieeefp.h: Comment about new configuration
macros _FLT_LARGEST_EXPONENT_IS_NORMAL and _FLT_NO_DENORMALS. * libm/common/fdlib.h: Define new macros for testing floats. * libm/common/sf_*: Use them. * libm/math/ef_*: Likewise. * libm/math/sf_*: Likewise.
Diffstat (limited to 'newlib/libm/common/sf_cbrt.c')
-rw-r--r--newlib/libm/common/sf_cbrt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/newlib/libm/common/sf_cbrt.c b/newlib/libm/common/sf_cbrt.c
index c053d9548..fe632f0a8 100644
--- a/newlib/libm/common/sf_cbrt.c
+++ b/newlib/libm/common/sf_cbrt.c
@@ -53,13 +53,14 @@ G = 3.5714286566e-01; /* 5/14 = 0x3eb6db6e */
GET_FLOAT_WORD(hx,x);
sign=hx&0x80000000; /* sign= sign(x) */
hx ^=sign;
- if(hx>=0x7f800000) return(x+x); /* cbrt(NaN,INF) is itself */
- if(hx==0)
- return(x); /* cbrt(0) is itself */
+ if(!FLT_UWORD_IS_FINITE(hx))
+ return(x+x); /* cbrt(NaN,INF) is itself */
+ if(FLT_UWORD_IS_ZERO(hx))
+ return(x); /* cbrt(0) is itself */
SET_FLOAT_WORD(x,hx); /* x <- |x| */
/* rough cbrt to 5 bits */
- if(hx<0x00800000) /* subnormal number */
+ if(FLT_UWORD_IS_SUBNORMAL(hx)) /* subnormal number */
{SET_FLOAT_WORD(t,0x4b800000); /* set t= 2**24 */
t*=x; GET_FLOAT_WORD(high,t); SET_FLOAT_WORD(t,high/3+B2);
}