1 #include <math.h>
2 
logbf(float x)3 float logbf(float x) {
4     if (!isfinite(x))
5         return x * x;
6     if (x == 0)
7         return -1 / (x * x);
8     return ilogbf(x);
9 }
10