Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. int v = 30000; // 32-bit word to find the log base 2 of
  2. int r = 0; // r will be lg(v)
  3.  
  4. while ( (v >>= 1) != 0) // unroll for more speed...
  5. {
  6. r++;
  7. }
  8.  
  9. Math.Floor(Math.Log(30000, 2)) + 1
  10.  
  11. (int) Math.Log(30000, 2) + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement