From: Vivien Maisonneuve Date: Tue, 19 Aug 2014 09:30:21 +0000 (+0200) Subject: Variable renaming in LinExpr.scaleint() X-Git-Tag: 1.0~55 X-Git-Url: https://scm.cri.ensmp.fr/git/linpy.git/commitdiff_plain/4af78812d25b28cee283e671c0bd5944133b6ce5?hp=42c85c00b3ed474312c4b66a3da0e8208c60d231 Variable renaming in LinExpr.scaleint() --- 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): """