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

divrem broken in packages using AbstractAlgebra #257

Closed
thofma opened this issue Feb 1, 2019 · 1 comment
Closed

divrem broken in packages using AbstractAlgebra #257

thofma opened this issue Feb 1, 2019 · 1 comment

Comments

@thofma
Copy link
Member

thofma commented Feb 1, 2019

@wbhart @heiderich
Before #252 :

julia> using Nemo

julia> Qx, x  = PolynomialRing(FlintQQ, "x");

julia> K, a = NumberField(x^3 + 3x + 1, "a")
(Number field over Rational Field with defining polynomial x^3+3*x+1, a)

julia> divrem(a, a)
(1, 0)

After #252

julia> divrem(a, a)
ERROR: MethodError: no method matching rem(::nf_elem, ::nf_elem)
Closest candidates are:
  rem(::Any, ::Any, ::RoundingMode{:ToZero}) at math.jl:739
  rem(::Any, ::Any, ::RoundingMode{:Down}) at math.jl:740
  rem(::Any, ::Any, ::RoundingMode{:Up}) at math.jl:741
@wbhart
Copy link
Contributor

wbhart commented Feb 1, 2019

Yeah, I thought it would be broken. We must overload Base.divrem everywhere (except for Julia types), not divrem. Otherwise it falls back to a generic method which calls rem. And of course that is not defined in this case.

thofma added a commit that referenced this issue Feb 2, 2019
wbhart added a commit that referenced this issue Feb 3, 2019
@thofma thofma closed this as completed Feb 3, 2019
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

2 participants