Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int v = 30000; // 32-bit word to find the log base 2 of
- int r = 0; // r will be lg(v)
- while ( (v >>= 1) != 0) // unroll for more speed...
- {
- r++;
- }
- Math.Floor(Math.Log(30000, 2)) + 1
- (int) Math.Log(30000, 2) + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement