From 37e405ce2fd62100749f944c28e69887cf79dd7e Mon Sep 17 00:00:00 2001 From: Tobias Glaubach Date: Tue, 17 Jul 2018 23:53:52 +0200 Subject: [PATCH] small fixes --- src/Numerics/Polynomial.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Numerics/Polynomial.cs b/src/Numerics/Polynomial.cs index efc1499b..ce2e6cd9 100644 --- a/src/Numerics/Polynomial.cs +++ b/src/Numerics/Polynomial.cs @@ -103,8 +103,10 @@ namespace MathNet.Numerics while (i >= 0 && Coeffs[i] == 0.0) i--; - if (i <= 0) + if (i < 0) Coeffs = new double[1] { 0.0 }; + else if (i == 0) + Coeffs = new double[1] { Coeffs[0] }; else { var hold = new double[i+1]; @@ -686,7 +688,7 @@ namespace MathNet.Numerics public object Clone() { - return new Polynomial(p); + return new Polynomial(this.Coeffs); } #endregion