From b1e8e26c8b9a327cc417e8bab679aa29b786a5dc Mon Sep 17 00:00:00 2001 From: Ludwig-Uni Date: Thu, 13 Jul 2023 18:42:18 +0200 Subject: [PATCH] Fix ToString for constant polynomial 1 --- LazyMathInstructor/Polynomial.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LazyMathInstructor/Polynomial.cs b/LazyMathInstructor/Polynomial.cs index 1539a3d..ec2e747 100644 --- a/LazyMathInstructor/Polynomial.cs +++ b/LazyMathInstructor/Polynomial.cs @@ -276,7 +276,7 @@ public override bool Equals(object obj) /// public override string ToString() { - return string.Join(" + ", Coefficients.Select(x => (x.Value == 1 ? "" : x.Value) + return string.Join(" + ", Coefficients.Select(x => (x.Value == 1 && x.Key.Exponents.Any() ? "" : x.Value) + x.Key.ToString())); } }