]> CRI, Mines Paris - PSL - linpy.git/commitdiff
Fix Symbol creation
authorVivien Maisonneuve <v.maisonneuve@gmail.com>
Thu, 19 Jun 2014 07:08:45 +0000 (09:08 +0200)
committerVivien Maisonneuve <v.maisonneuve@gmail.com>
Thu, 19 Jun 2014 07:08:45 +0000 (09:08 +0200)
pypol/linear.py

index bd7037b5ed3ae5629077c9fb117be7480544ef4c..8f73fd312ff753d5d9d53e605eae2cb582b48a6b 100644 (file)
@@ -62,7 +62,7 @@ class Expression:
                 for symbol, coefficient in coefficients if coefficient != 0]
         if len(coefficients) == 0:
             return Constant(constant)
-        elif len(coefficients) == 1:
+        elif len(coefficients) == 1 and constant == 0:
             symbol, coefficient = coefficients[0]
             if coefficient == 1:
                 return Symbol(symbol)