dzhang314 / MultiFloats.jl

Fast, SIMD-accelerated extended-precision arithmetic for Julia
MIT License
77 stars 10 forks source link

Support ranges (if possible) #33

Open nsajko opened 2 years ago

nsajko commented 2 years ago

These all fail with MethodError: no method matching round(::MultiFloat{Float64, 2}, ::RoundingMode{:Down}):

map(Float64x2, 0:5)
Float64x2(0):Float64x2(5)
Float64x2(0):Float64x2(1):Float64x2(5)

The workaround is to use generators:

julia> (Float64x2(i) for i in 0:3)
Base.Generator{UnitRange{Int64}, var"#3#4"}(var"#3#4"(), 0:3)
dzhang314 commented 2 years ago

Hey @nsajko, thanks for your interest in MultiFloats.jl and for putting this on my radar! The use of MultiFloats in ranges totally hadn't occurred to me, and this is something definitely worth supporting.

Unfortunately, it's been a while since I've had time to work on MultiFloats.jl -- grad school is occupying all my coding capacity at the moment -- but this will certainly be on the list for the next version when I get around to it.