diff options
Diffstat (limited to 'newlib/libm/math/ef_hypot.c')
-rw-r--r-- | newlib/libm/math/ef_hypot.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/newlib/libm/math/ef_hypot.c b/newlib/libm/math/ef_hypot.c index a87fa489e..9f6d40c9c 100644 --- a/newlib/libm/math/ef_hypot.c +++ b/newlib/libm/math/ef_hypot.c @@ -35,10 +35,10 @@ if((ha-hb)>0xf000000L) {return a+b;} /* x/y > 2**30 */ k=0; if(ha > 0x58800000L) { /* a>2**50 */ - if(ha >= 0x7f800000L) { /* Inf or NaN */ + if(!FLT_UWORD_IS_FINITE(ha)) { /* Inf or NaN */ w = a+b; /* for sNaN */ - if(ha == 0x7f800000L) w = a; - if(hb == 0x7f800000L) w = b; + if(FLT_UWORD_IS_INFINITE(ha)) w = a; + if(FLT_UWORD_IS_INFINITE(hb)) w = b; return w; } /* scale a and b by 2**-60 */ @@ -47,8 +47,9 @@ SET_FLOAT_WORD(b,hb); } if(hb < 0x26800000L) { /* b < 2**-50 */ - if(hb <= 0x007fffffL) { /* subnormal b or 0 */ - if(hb==0) return a; + if(FLT_UWORD_IS_ZERO(hb)) { + return a; + } else if(FLT_UWORD_IS_SUBNORMAL(hb)) { SET_FLOAT_WORD(t1,0x3f000000L); /* t1=2^126 */ b *= t1; a *= t1; |