Rockbox mail archiveSubject: Re: Log base 2
Re: Log base 2
From: Jeff Waltzer <jeffwaltzer_at_yahoo.com>
Date: Thu, 19 Sep 2002 13:42:22 -0700 (PDT)
This code on that link:
g = 15;
while(g && !(x&0x8000) ) // loop until msb of x occupies bit 15
x <<= 1;
is pretty much what I was suggesting. :)
--- Philipp Pertermann <philipp.pertermann_at_web.de> wrote:
> From: "Jeff Waltzer"
> > One could do a primitive approximation of a Log base 2
> function by
> > rotating the bits to find the left most location set bit.
> This would be
> > good if all you need is a number from 0 to 15.
> I believe I already found the perfect link. I just hate math
> and have been to lazy to understand that yet.
Whoever fights monsters should see to it that in the process he doesn't become a monster.
--Frederick Wilhelm Nietsche
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
Received on 2002-09-19