Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No method matching round(MF) #24

Open
lrnv opened this issue Apr 30, 2021 · 0 comments
Open

No method matching round(MF) #24

lrnv opened this issue Apr 30, 2021 · 0 comments

Comments

@lrnv
Copy link
Contributor

lrnv commented Apr 30, 2021

Doing some optimisations, I encountered the lack of rounding method for MultiFloats:

ERROR: MethodError: no method matching round(::MultiFloat{Float64, 4}, ::RoundingMode{:Up})
Closest candidates are:
  round(::Real, ::RoundingMode; digits, sigdigits, base) at floatfuncs.jl:129
  round(::Complex, ::RoundingMode) at complex.jl:1038
  round(::Complex, ::RoundingMode, ::RoundingMode; kwargs...) at complex.jl:1038

Same thing happend for trunc. Setting:

import Base.round, Base.trunc
Base.round(x::MultiFloat{Float64, 4}, y::RoundingMode{:Up}) = MultiFloat{Float64, 4}(Base.round(Float64(x),y))
Base.trunc(x::Type{Int64}, y::MultiFloat{Float64, 4}) = Base.trunc(x::Type{Int64}, Float64(y))

fixed the problem for my script, but i'm not sure it's the right thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant