X-Git-Url: https://scm.cri.mines-paristech.fr/git/linpy.git/blobdiff_plain/4162c0430092e0ba2b8d8d62b5de24cdd71abe3b..1044e58e639333d281d47739ba9ecef607ff14e6:/linpy/linexprs.py diff --git a/linpy/linexprs.py b/linpy/linexprs.py index 3c00f22..f361218 100644 --- a/linpy/linexprs.py +++ b/linpy/linexprs.py @@ -306,7 +306,7 @@ class LinExpr: for symbol in substitutions: if not isinstance(symbol, Symbol): raise TypeError('symbols must be Symbol instances') - result = self._constant + result = Rational(self._constant) for symbol, coefficient in self._coefficients.items(): expression = substitutions.get(symbol, symbol) result += coefficient * expression