You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> using MultiFloats
julia> MultiFloats.use_standard_multifloat_arithmetic(20)
julia> g(n::Integer) = rand(MultiFloat{Float64, n})
g (generic function with 1 method)
julia> x = g(20)
-2.2914735159347884e+302
julia> 1 < x
false
julia> x < -1
true
julia> Float64(x)
0.6714350546186427
So it seems there are multiple issues here:
rand produces a number of huge magnitude
rand produces negative number
the conversion to Float64 (producing a positive number) is not consistent with the < operator
The text was updated successfully, but these errors were encountered:
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<
operatorThe text was updated successfully, but these errors were encountered: