public Monomial(Monomial from) { this.parser = from.parser; this.coefficient = from.coefficient; this.variable = from.variable; this.exponent = from.exponent; this.expression = parser.CombineStringExpression(this.coefficient, this.variable, this.exponent); }
public Monomial(decimal?coefficient, string variable, int?exponent, IExpressionParser parser) { this.parser = parser; this.coefficient = coefficient ?? 1; this.variable = variable?.Trim(); this.exponent = exponent; this.expression = parser.CombineStringExpression(this.coefficient, this.variable, this.exponent); }