X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/blobdiff_plain/42c85c00b3ed474312c4b66a3da0e8208c60d231..4af78812d25b28cee283e671c0bd5944133b6ce5:/linpy/linexprs.py diff --git a/linpy/linexprs.py b/linpy/linexprs.py index e4ed1cc..a49f90e 100644 --- a/linpy/linexprs.py +++ b/linpy/linexprs.py @@ -273,9 +273,9 @@ class LinExpr: Return the expression multiplied by its lowest common denominator to make all values integer. """ - lcm = functools.reduce(lambda a, b: a*b // gcd(a, b), + lcd = functools.reduce(lambda a, b: a*b // gcd(a, b), [value.denominator for value in self.values()]) - return self * lcm + return self * lcd def subs(self, symbol, expression=None): """