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
  • 20,932
  • 2
  • 55
  • 89
darenn
  • 459
  • 4
  • 15

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
  • 82,547
  • 12
  • 135
  • 231
Bernd Elkemann
  • 22,963
  • 4
  • 39
  • 63