Closed nsajko closed 1 week ago
Hey @nsajko, thanks for your interest in MultiFloats.jl! I finally got around to looking at this today (sorry it took a while), and it turns out this was happening because a Float64x{20}
is so long, the exponent underflows past -1024, causing the final limb to overflow to an extremely large number. I've fixed this by adding an explicit underflow check and returning 0.0
if it's hit.
Please note that Float64x{20}
is not useful because it is so long, the final component is essentially guaranteed to underflow out of the allowed exponent range for a Float64
. In practical usage, you don't want to go past about Float64x8
.
You will see the fix in the next release of MultiFloats.jl.
So it seems there are multiple issues here:
rand
produces a number of huge magnituderand
produces negative numberFloat64
(producing a positive number) is not consistent with the<
operator