From d2dffa8ff7f929b5948540fc2302d5f17e1aa8d8 Mon Sep 17 00:00:00 2001 From: lafrite Date: Wed, 20 May 2015 18:49:51 +0200 Subject: [PATCH] solve a bug with par and ^ --- pymath/operator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pymath/operator.py b/pymath/operator.py index b643cad..df16a9f 100644 --- a/pymath/operator.py +++ b/pymath/operator.py @@ -570,6 +570,11 @@ class op(object): except AttributeError as e: # op has not the attribute priority pass + try: + if int(opl) < 0: + ans = ["(", opl, ")"] + except ValueError: + pass ans = flatten_list([ans]) if str_join: