>>>>> "KF" == Ken Fox <[EMAIL PROTECTED]> writes:

  > Jason Gloudon wrote:
  >> http://www.ddj.com/ftp/2001/2001_07/aa0701.txt
  >> I believe the LOOKUP method was the fastest for me on SPARC, if I
  >> recall
  >> correctly.

  > Did they really spend 64K to create a lookup table just to find
  > the most significant bit? Calculating log2 for a power of two is
  > simpler -- all you need to find is the one set bit. If you really
  > want to use lookup tables, just use an 8 byte table and shift
  > by 4 bits until a non-zero is found. (Change constants to taste.)

it is the old space/time tradeoff. a 64k table can do this in one lookup
and no loops so it should be fastest (excluding cache hit issues and
such).

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to