diff options
Diffstat (limited to 'lib/libm/logbf.c')
| -rw-r--r-- | lib/libm/logbf.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libm/logbf.c b/lib/libm/logbf.c new file mode 100644 index 00000000..2344ed3a --- /dev/null +++ b/lib/libm/logbf.c @@ -0,0 +1,10 @@ +#include <math.h> + +float logbf(float x) +{ + if (!isfinite(x)) + return x * x; + if (x == 0) + return -1 / (x * x); + return ilogbf(x); +} |
