ref: aaad5f4c82f96f96103c545a5db4e46ef4e22d33
dir: /libnpe/log2.c/
#include <math.h>
#include "_npe.h"
double
log2(double x)
{
if(x == 0)
return -hugeD;
if(x < 0 || isNaN(x))
return NaN();
return log(x)*ln2o1;
}
float
log2f(float x)
{
if(x == 0)
return -hugeF;
return log2(x);
}