Fast Integer Log2 function in C/C++
Some times, it happens that you need to have a high performance function that you usually use in a not optimized way. And since you never needed to optimize it you hesitated before realising it can be severly improved. Probably, this is what you would think of the integer log2 function, in general this function is used on not critic code so it can be “slow” without creating any problem (often used to calculate the size of a power of 2 texture to hold an image)
Read the rest of this entry »
