diff options
Diffstat (limited to 'libquadmath/math/log10q.c')
-rw-r--r-- | libquadmath/math/log10q.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libquadmath/math/log10q.c b/libquadmath/math/log10q.c index 9eeb9ae3fc4..3afb1121267 100644 --- a/libquadmath/math/log10q.c +++ b/libquadmath/math/log10q.c @@ -188,12 +188,15 @@ log10q (__float128 x) /* Test for domain */ GET_FLT128_WORDS64 (hx, lx, x); if (((hx & 0x7fffffffffffffffLL) | lx) == 0) - return (-1.0Q / (x - x)); + return (-1.0Q / fabsq (x)); /* log10l(+-0)=-inf */ if (hx < 0) return (x - x) / (x - x); if (hx >= 0x7fff000000000000LL) return (x + x); + if (x == 1.0Q) + return 0.0Q; + /* separate mantissa from exponent */ /* Note, frexp is used so that denormal numbers |