diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2001-04-04 13:33:01 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2001-04-04 13:33:01 +0000 |
commit | 16740220a22d09a1c63714d93f1efc5fbe3927f3 (patch) | |
tree | 7b24242b9b20a0ee328c94acd2c95e1a8778c944 /newlib/libm/math/ef_j0.c | |
parent | 51fc3813e9a9ef8079b2fbde1b12647dd3f4ac93 (diff) | |
download | cygnal-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/math/ef_j0.c')
-rw-r--r-- | newlib/libm/math/ef_j0.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/newlib/libm/math/ef_j0.c b/newlib/libm/math/ef_j0.c index e7ee6e748..866cfcf96 100644 --- a/newlib/libm/math/ef_j0.c +++ b/newlib/libm/math/ef_j0.c @@ -58,14 +58,14 @@ static float zero = 0.0; GET_FLOAT_WORD(hx,x); ix = hx&0x7fffffff; - if(ix>=0x7f800000) return one/(x*x); + if(!FLT_UWORD_IS_FINITE(ix)) return one/(x*x); x = fabsf(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ s = sinf(x); c = cosf(x); ss = s-c; cc = s+c; - if(ix<0x7f000000) { /* make sure x+x not overflow */ + if(ix<=FLT_UWORD_HALF_MAX) { /* make sure x+x not overflow */ z = -cosf(x+x); if ((s*c)<zero) cc = z/ss; else ss = z/cc; @@ -128,8 +128,8 @@ v04 = 4.4111031494e-10; /* 0x2ff280c2 */ GET_FLOAT_WORD(hx,x); ix = 0x7fffffff&hx; /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */ - if(ix>=0x7f800000) return one/(x+x*x); - if(ix==0) return -one/zero; + if(!FLT_UWORD_IS_FINITE(ix)) return one/(x+x*x); + if(FLT_UWORD_IS_ZERO(ix)) return -one/zero; if(hx<0) return zero/zero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0)) @@ -151,7 +151,7 @@ v04 = 4.4111031494e-10; /* 0x2ff280c2 */ * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x) * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x) */ - if(ix<0x7f000000) { /* make sure x+x not overflow */ + if(ix<=FLT_UWORD_HALF_MAX) { /* make sure x+x not overflow */ z = -cosf(x+x); if ((s*c)<zero) cc = z/ss; else ss = z/cc; |