My Integer Doesn't fit

I was playing on my computer and accidentally tried this expression to see what the computer would output: julia> 9007199254740992.0 + 1.0 == 9007199254740992.0 The REPL output was: julia> 9007199254740992.0 + 1.0 == 9007199254740992.0 true This is obviously incorrect mathematically. However, this arbitrary number is the maximum integer that a 64-bit float can store. In Julia, this number can be found using the maxintfloat function with the Float64 type: julia> maxintfloat(Float64) + 1 == maxintfloat(Float64) true Interestingly enough, adding two “fixes” the comparison:...

July 18, 2025 · 1 min · Markus A.G. Amano