Remix.run Logo
fiforpg 2 days ago

In the context of double precision the article says

> the largest integer value that can be represented exactly is 2^53

— I am confused as to why it not 2^52, given that there are 52 bits of mantissa, so relative accuracy is 2^-52, which translates to absolute accuracy larger than 1 after 2^52. Compare this to the table there saying "Next value after 1 = 1 + 2^-52".

pclmulqdq 2 days ago | parent | next [-]

There's an implied one bit, so you actually have a 53 bit significand (and 53-bit precision) given only a 52 bit mantissa.

fiforpg 2 days ago | parent [-]

Right, I did realize after posting that close to numbers of the form

1{hidden bit} + (1-2^-52){mantissa with all ones}

the relative accuracy — corresponding to the absolute accuracy of a single bit in mantissa — is about 2^-53. The hidden bit is easy to forget about...

layer8 2 days ago | parent | prev [-]

https://stackoverflow.com/questions/1848700/biggest-integer-...