Skip to content

Implement comparison between Nemo and Singular rationals #908

Description

@fingolfin

Consider this:

julia> Singular.QQ(5) == 5
true

julia> Singular.QQ(5) == Nemo.ZZ(5)
true

julia> Singular.QQ(5) == Nemo.QQ(5)
false

Ooops!

The latter is of course quite bad and misleading. The cause is a problematic fallback in AbstractAlgbebra:

function ==(x::NCRingElem, y::NCRingElem)
   fl, u, v = try_promote(x, y)
   if fl
     return u == v
   else
     return false
   end
 end

We should address that there (and indeed, we tried that last year and it fizzled out, but we probably should get back to that. See Nemocas/AbstractAlgebra.jl#1853, Nemocas/AbstractAlgebra.jl#1854, Nemocas/AbstractAlgebra.jl#1873)

But of course in the meantime, we also should add suitable comparison methods in Singular.jl

CC @fieker @hannes14

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions