log of 64 bit integer

Revision en1, by _Bash_, 2019-09-08 21:37:05

I wanted to calculate log2 of a 64 bit integer suppose 10^18 i.e. log2(10^18). I came across an answer on stackoverflow(Link) that does it, but it is difficult to understand. Can someone explain the logic behind the answer ?? Thanks in advance..Thankyou.

Tags logarithmic

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English _Bash_ 2019-09-08 21:37:05 385 Initial revision (published)