diff options
author | Reinier Heeres <rwh@rwh.(none)> | 2008-02-18 00:06:48 (GMT) |
---|---|---|
committer | Reinier Heeres <rwh@rwh.(none)> | 2008-02-18 00:06:48 (GMT) |
commit | cb8e7ace5c8d214b247341a2a885ed24f5d69b38 (patch) | |
tree | 663a248671af99715919cbe028232178270e1d63 | |
parent | ca70f0e3f46eb2fc6f386245893a9309f51951f6 (diff) |
Limit range using Rational numbers to <1e10
-rw-r--r-- | eqnparser.py | 3 |
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) |