diff options
author | Gary Martin <gary@garycmartin.com> | 2012-03-20 14:51:18 (GMT) |
---|---|---|
committer | Gary Martin <gary@garycmartin.com> | 2012-03-20 14:51:18 (GMT) |
commit | a2cbde202c7450b12b118b688d8399a6c836ca10 (patch) | |
tree | 60348330c285ce9c75d783c762ab4ad27433bde5 | |
parent | 2690934c0fc7c20b72884307e3759ec71ec1fdc8 (diff) |
Trivial divide calculations can generate results with rounding errors #SL2332 (Miguel Garcia).
-rw-r--r-- | mathlib.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -221,7 +221,7 @@ class MathLib: elif type(n) is types.LongType: n = self.d(n) elif isinstance(n, Rational): - n = self.d(float(n)) + n = self.d(Decimal(n.n) / Decimal(n.d)) elif not isinstance(n, Decimal): return _('Error: unsupported type') |