diff --git a/src/math/logb.c b/src/math/logb.c index 624425a81165b219a973dee4c3d0f6cbe2c3c43c..7f8bdfae19f8ca0a85b611d38a73695ccf588e43 100644 --- a/src/math/logb.c +++ b/src/math/logb.c @@ -1,4 +1,4 @@ -#include "libm.h" +#include /* special cases: @@ -12,6 +12,6 @@ double logb(double x) if (!isfinite(x)) return x * x; if (x == 0) - return -1/(x+0); + return -1/(x*x); return ilogb(x); } diff --git a/src/math/logbf.c b/src/math/logbf.c index 950d35697bbe4abaa9a0ac83b70d5dbf6229359b..a0a0b5ed5be57de3e3ce05811af631f2ca88898a 100644 --- a/src/math/logbf.c +++ b/src/math/logbf.c @@ -1,10 +1,10 @@ -#include "libm.h" +#include float logbf(float x) { if (!isfinite(x)) return x * x; if (x == 0) - return -1/(x+0); + return -1/(x*x); return ilogbf(x); } diff --git a/src/math/logbl.c b/src/math/logbl.c index f3850745812bcfdc797603502d188bf4245b9c10..962973a7b99bfffdcb2c1677a3c0b2ba5f87d357 100644 --- a/src/math/logbl.c +++ b/src/math/logbl.c @@ -1,4 +1,4 @@ -#include "libm.h" +#include #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double logbl(long double x) { @@ -10,7 +10,7 @@ long double logbl(long double x) if (!isfinite(x)) return x * x; if (x == 0) - return -1/(x+0); + return -1/(x*x); return ilogbl(x); } #endif