in reply to Re^2: reliable get position of leftmost bit in large integers
in thread reliable get position of leftmost bit in large integers

The problem is that ** returns a double (floating point), which explains the lack of precision. You should use 1<<54 like BrowserUk did in his answer.

  • Comment on Re^3: reliable get position of leftmost bit in large integers

Replies are listed 'Best First'.
Re^4: reliable get position of leftmost bit in large integers
by BrowserUk (Patriarch) on Mar 12, 2015 at 14:35 UTC
    You should use 1<<54 like BrowserUk did in his answer.

    Even old dogs can learn :)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked