1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-08-02 06:43:27 +02:00

more verbose throws in divexact

This commit is contained in:
kalmar 2017-07-24 22:50:52 +02:00
parent b4aa2f3582
commit 1862868a35

View File

@ -432,11 +432,11 @@ end
function divexact{T}(X::GroupRingElem{T}, Y::GroupRingElem{T}) function divexact{T}(X::GroupRingElem{T}, Y::GroupRingElem{T})
if length(Y) != 1 if length(Y) != 1
throw("Can not divide by a non-primitive element $(Y)!") throw("Can not divide by a non-primitive element: $(Y)!")
else else
idx = findfirst(Y) idx = findfirst(Y)
c = Y[idx] c = Y[idx]
c == 0 || throw("Can not invert") c != 0 || throw("Can not invert: $c not found in $Y")
g = parent(Y).basis[idx] g = parent(Y).basis[idx]
return X*1//c*parent(Y)(inv(g)) return X*1//c*parent(Y)(inv(g))
end end