PowerOfx
Basic 25.43 3.24 1.98 39%
Ada 28.72 11.42 6.97 39%
2 2
log(x)base = log(x)/log(base)
unsigned int log2(unsigned int x)
{
return(unsigned int)(1og(x)/log(2));
}
log(2) 0.69314718 log(2)
unsigned int log2(unsigned int x)
{
return((unsigned int)(log(x)/LOG2)); LOG2 0.6931478
}
Log()
log()
C 29.00 21.74 25%
Fortran 43.06 32.95 23%