throw if dividing by a non-unit

This commit is contained in:
kalmar 2017-07-11 22:37:53 +02:00
parent 7ce52c6997
commit 4e213c691d
1 changed files with 2 additions and 0 deletions

View File

@ -387,10 +387,12 @@ function divexact{T}(X::GroupRingElem{T}, Y::GroupRingElem{T})
else
idx = findfirst(Y)
c = Y[idx]
c == 0 || throw("Can not invert")
g = parent(Y).basis[idx]
return X*1//c*parent(Y)(inv(g))
end
end
###############################################################################
#
# *-involution