Skip to content

Commit

Permalink
Fix ToString for constant polynomial 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludwig-Work committed Jul 13, 2023
1 parent ad294d2 commit b1e8e26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LazyMathInstructor/Polynomial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public override bool Equals(object obj)
/// </summary>
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()));
}
}
Expand Down

0 comments on commit b1e8e26

Please sign in to comment.