From d8a24a13490b5f80cc6f47d0f61bdd526a4de2ae Mon Sep 17 00:00:00 2001 From: Slavasil Date: Mon, 13 Apr 2026 13:59:04 +0300 Subject: [PATCH] fix 1x being printed instead of x --- lib/ruby_algebra/polynomial.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ruby_algebra/polynomial.rb b/lib/ruby_algebra/polynomial.rb index 1ddf2a9..5d5faa6 100644 --- a/lib/ruby_algebra/polynomial.rb +++ b/lib/ruby_algebra/polynomial.rb @@ -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|