Explorar o código

Fixed typo in combine_polynomes.

Sander Mathijs van Veen %!s(int64=14) %!d(string=hai) anos
pai
achega
491d79ab4f
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/rules/poly.py

+ 4 - 1
src/rules/poly.py

@@ -79,7 +79,10 @@ def combine_polynomes(root, args):
     n0, n1, c0, c1, r, e = args
 
     # a ^ 1 -> a
-    power = r if e == 1 else r ^ e
+    if e == 1:
+        power = r
+    else:
+        power = r ** e
 
     # replacement: (c0 + c1) * a ^ b
     # a, b and c are from 'left', d is from 'right'.