I know that log2(x) accuracy fails when x is large enough and is in the form 2^n-1 for most languages, except R and Matlab may be. Any specific reasons ?
Edit 1: x is an integer around 10^15 and up
When x is large enough (about 4.5E15 for an IEEE double, I think), 2^n-1 isn't representable.
Can anyone explain the inaccuracy in log2 in C++/Python?