X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/blobdiff_plain/4162c0430092e0ba2b8d8d62b5de24cdd71abe3b..23922aa39e585f1e6b11f3479da002c92bebf2a1:/linpy/linexprs.py?ds=inline 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