In Julia and Nemo, the slash operator is floating point division. For 
example, 1/2 is 0.5 not a half. For division in a ring, you want divexact 
(there is also a separate operator, div, for Euclidean division).

At the moment, the code in Nemo for this is actually incorrect, so it only 
gives you an answer in one of the two examples in this thread and an 
exception in the other case. It's not a difficult fix. It should be in the 
next version of Nemo.

In AbstractAlgebra (pure Julia, no Flint), we get:

julia> using AbstractAlgebra

Welcome to AbstractAlgebra version 0.0.6

AbstractAlgebra comes with absolutely no warranty whatsoever

julia> R = ResidueRing(ZZ, 6)
Residue ring of Integers modulo 6

julia> a = R(5)
5

julia> b = R(4)
4

julia> c = a*b
2

julia> divexact(c, a)
4

julia> divexact(c, b)
2

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to