summaryrefslogtreecommitdiffstats
path: root/newlib/libm/math/ef_log.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libm/math/ef_log.c')
-rw-r--r--newlib/libm/math/ef_log.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/newlib/libm/math/ef_log.c b/newlib/libm/math/ef_log.c
index 87d6af2c5..619fe9090 100644
--- a/newlib/libm/math/ef_log.c
+++ b/newlib/libm/math/ef_log.c
@@ -50,14 +50,14 @@ static float zero = 0.0;
GET_FLOAT_WORD(ix,x);
k=0;
- if (ix < 0x00800000) { /* x < 2**-126 */
- if ((ix&0x7fffffff)==0)
- return -two25/zero; /* log(+-0)=-inf */
- if (ix<0) return (x-x)/zero; /* log(-#) = NaN */
+ if (FLT_UWORD_IS_ZERO(ix&0x7fffffff))
+ return -two25/zero; /* log(+-0)=-inf */
+ if (ix<0) return (x-x)/zero; /* log(-#) = NaN */
+ if (!FLT_UWORD_IS_FINITE(ix)) return x+x;
+ if (FLT_UWORD_IS_SUBNORMAL(ix)) {
k -= 25; x *= two25; /* subnormal number, scale up x */
GET_FLOAT_WORD(ix,x);
}
- if (ix >= 0x7f800000) return x+x;
k += (ix>>23)-127;
ix &= 0x007fffff;
i = (ix+(0x95f64<<3))&0x800000;