Блог пользователя BlueBlade

Автор BlueBlade, история, 6 лет назад, По-английски

What is the ans of floor of log2(288230376151711743) ??? Run a code with builtin log2() function, ans is 58 !!! Even google gives the ans 58 !!! Now write a code yourself to find the log2(x), and put x = 288230376151711743 . The actual answer is 57 !!!

couldn't get it !!!

  • Проголосовать: нравится
  • -16
  • Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

It uses double precision and it is 57.99999999999999999499464608778919110696411496790292147213... Check: [WolframAlpha](https://www.wolframalpha.com/input/?i=log2(288230376151711743))

»
6 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

try to output log2(x) + 1e-9