summaryrefslogtreecommitdiff
path: root/lib/libm/logbf.c
blob: e664e59751c79e01c41a77b14e69d7db0ae0c8b1 (plain)
1
2
3
4
5
6
7
8
9
10
#include <math.h> // for ilogbf, logbf, isfinite

float logbf(float x)
{
	if (!isfinite(x))
		return x * x;
	if (x == 0)
		return -1 / (x * x);
	return ilogbf(x);
}