remove another invalid skip of locking in ungetwc
[oweals/musl.git] / src / math / logbf.c
index 934827f885b7e388eacce766cdd30090fc329487..a0a0b5ed5be57de3e3ce05811af631f2ca88898a 100644 (file)
@@ -1,12 +1,10 @@
-#include <limits.h>
-#include "libm.h"
+#include <math.h>
 
-float logbf(float x) {
-       int i = ilogbf(x);
-
-       if (i == FP_ILOGB0)
-               return -1.0f/fabsf(x);
-       if (i == FP_ILOGBNAN || i == INT_MAX)
+float logbf(float x)
+{
+       if (!isfinite(x))
                return x * x;
-       return i;
+       if (x == 0)
+               return -1/(x*x);
+       return ilogbf(x);
 }