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/common/sf_nextafter.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/common/sf_nextafter.c')
-rw-r--r-- | newlib/libm/common/sf_nextafter.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/newlib/libm/common/sf_nextafter.c b/newlib/libm/common/sf_nextafter.c index cd938d339..cea4da58d 100644 --- a/newlib/libm/common/sf_nextafter.c +++ b/newlib/libm/common/sf_nextafter.c @@ -29,15 +29,15 @@ ix = hx&0x7fffffff; /* |x| */ iy = hy&0x7fffffff; /* |y| */ - if((ix>0x7f800000) || /* x is nan */ - (iy>0x7f800000)) /* y is nan */ - return x+y; + if(FLT_UWORD_IS_NAN(ix) || + FLT_UWORD_IS_NAN(iy)) + return x+y; if(x==y) return x; /* x=y, return x */ - if(ix==0) { /* x == 0 */ - SET_FLOAT_WORD(x,(hy&0x80000000)|1);/* return +-minsubnormal */ + if(FLT_UWORD_IS_ZERO(ix)) { /* x == 0 */ + SET_FLOAT_WORD(x,(hy&0x80000000)|FLT_UWORD_MIN); y = x*x; if(y==x) return y; else return x; /* raise underflow flag */ - } + } if(hx>=0) { /* x > 0 */ if(hx>hy) { /* x > y, x -= ulp */ hx -= 1; @@ -52,7 +52,7 @@ } } hy = hx&0x7f800000; - if(hy>=0x7f800000) return x+x; /* overflow */ + if(hy>FLT_UWORD_MAX) return x+x; /* overflow */ if(hy<0x00800000) { /* underflow */ y = x*x; if(y!=x) { /* raise underflow flag */ |