Original Post
I need an optimized version of log base 2 or loading is going to be very slow for my game
. I know I can do this using a right bitshift but what's an efficient way of detecting when I'm at the end?
[edit] The number will only ever be a power of two so I don't need to worry about decimal places. Technically it could be not a power of two if someone hacks the map, but then they deserve to have the program crash horribly.
[edited by - Raloth on August 29, 2003 2:58:07 PM]