Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinier Heeres <rwh@rwh.(none)>2008-02-18 00:06:48 (GMT)
committer Reinier Heeres <rwh@rwh.(none)>2008-02-18 00:06:48 (GMT)
commitcb8e7ace5c8d214b247341a2a885ed24f5d69b38 (patch)
tree663a248671af99715919cbe028232178270e1d63
parentca70f0e3f46eb2fc6f386245893a9309f51951f6 (diff)
Limit range using Rational numbers to <1e10
-rw-r--r--eqnparser.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/eqnparser.py b/eqnparser.py
index 28167e7..a297c9b 100644
--- a/eqnparser.py
+++ b/eqnparser.py
@@ -667,7 +667,8 @@ class EqnParser:
def div_operator(self, a, b):
if isinstance(a, Rational) or isinstance(b, Rational):
return a / b
- elif self.ml.is_int(a) and self.ml.is_int(b):
+ elif self.ml.is_int(a) and self.ml.abs(a) < 1e12 and \
+ self.ml.is_int(b) and self.ml.abs(b) < 1e12:
return Rational(a, b)
else:
return self.ml.div(a, b)