From 20f0734d6f298fdbcde40fe6244a62ea0dc35821 Mon Sep 17 00:00:00 2001 From: kalmar Date: Wed, 17 May 2017 12:50:46 +0200 Subject: [PATCH] avoid comparison warnings in show --- src/GroupRings.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index 490a61e..8085ab4 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -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