integer-valued log base 2

PSYS ecampbel at gara.une.oz.au
Thu Oct 11 14:42:57 AEST 1990


Does anyone know a fast algorithm in C to compute
                (int)log2(x), x real in [0,1]
The standard C function frexp does this , but it can be as
slow as using the log function directly.
Any help will be appreciated.
Thanks



More information about the Comp.lang.c mailing list