소스 검색

Fixed typo in combine_polynomes.

Sander Mathijs van Veen 14 년 전
부모
커밋
491d79ab4f
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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'.