[comp.lang.c] integer-valued log base 2

ecampbel@gara.une.oz.au ( PSYS) (10/11/90)

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