Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!metro!grivel!gara!ecampbel From: ecampbel@gara.une.oz.au ( PSYS) Newsgroups: comp.lang.c Subject: integer-valued log base 2 Message-ID: <4196@gara.une.oz.au> Date: 11 Oct 90 04:42:57 GMT Organization: University of New England, Armidale, Australia Lines: 6 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