use -1/(x*x) instead of -1/(x+0) to return -inf, -0+0 is -0 in downward rounding mode
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include <math.h>
/*
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);
}
@@ -1,10 +1,10 @@
float logbf(float x)
{
return ilogbf(x);
#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)
return ilogbl(x);
#endif