X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/blobdiff_plain/4162c0430092e0ba2b8d8d62b5de24cdd71abe3b..0dba74e5eb85b09a85f0a986c3fbc6b5fcacceac:/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