Guest User

Untitled

a guest
Jul 17th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. template<typename Out,typename In>
  2. Out log2(In x)
  3. {
  4. for(Out i = 0; i<sizeof(In)*8; ++i){
  5. x = x >> 1;
  6. if(!x)
  7. return i;
  8. }
  9. }
Add Comment
Please, Sign In to add comment