fix 1x being printed instead of x

This commit is contained in:
2026-04-13 13:59:04 +03:00
parent 7a6f8974a8
commit d8a24a1349

View File

@@ -203,7 +203,7 @@ module RubyAlgebra
end
def to_s
result = coeff.to_s
result = @coeff != 1 ? @coeff.to_s : ''
unless @variables.empty?
first = true
@variables.each do |var, power|