1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-12-29 11:00:28 +01:00

avoid comparison warnings in show

This commit is contained in:
kalmar 2017-05-17 12:50:46 +02:00
parent 05b7274ee7
commit 20f0734d6f

View File

@ -157,11 +157,12 @@ function show(io::IO, A::GroupRing)
end
function show(io::IO, X::GroupRingElem)
if X == parent(X)()
T = eltype(X.coeffs)
if X == parent(X)(T)
print(io, "0*$((parent(X).group)())")
else
T = eltype(X.coeffs)
elts = ("$(X.coeffs[i])*$(parent(X).basis[i])" for i in 1:length(X) if X.coeffs[i] != zero(T))
elts = ("$(X[i])*$(parent(X).basis[i])" for i in 1:length(X) if X[i] != zero(T))
join(io, elts, " + ")
end
end