2

The question is as follows (same as in the title) :

What's the biggest integer n that in IEEE-754 of double precision all numbers from 0 to n are represented precisely (without rounding)?

I've been thinkin about it for some time now and couldn't think of the right solution. Could you help me? :)

Brett Hale
  • 21,653
  • 2
  • 61
  • 90
darenn
  • 469
  • 5
  • 17

1 Answers1

4

The answer for the largest integer that can be accurately represented has already been given.

Maybe you are curious about the smallest integer that can not be represented:

9,007,199,254,740,993 (2^53 + 1)

It is smaller because the integers that can be represented exactly by double (binary64) are not contiguous.

Gabe
  • 84,912
  • 12
  • 139
  • 238
Bernd Elkemann
  • 23,242
  • 4
  • 37
  • 66