3 ms·
That's an issue inherent in floating point computations with fixed precision (such as IEEE 754). julia> 1e20 + 1000 - 1e20 0.0 julia> 1e20 + 10000 - 1e2
by FabHK 5y ago
That's an issue inherent in floating point computations with fixed precision (such as IEEE 754).
julia> 1e20 + 1000 - 1e20
0.0
julia> 1e20 + 10000 - 1e20
16384.0
Python 3.9.6 (default, Jun 28 2021, 19:24:41)
>>> 1e20 + 1000 - 1e20
0.0
>>> 1e20 + 10000 - 1e20
16384.0