Ticket #2332: 0001-Ticket-2332-Rational-format-problem.patch

File 0001-Ticket-2332-Rational-format-problem.patch, 723 bytes (added by miguelgarcia, 12 years ago)

patch for this issue

  • mathlib.py

    From e5fcfff75c5eb760e7ded471521a4a097ec80971 Mon Sep 17 00:00:00 2001
    From: Miguel Garcia <miguel.garcia@gmail.com>
    Date: Mon, 19 Mar 2012 04:14:57 -0300
    Subject: [PATCH] Ticket #2332 Rational format problem
    
    ---
     mathlib.py |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/mathlib.py b/mathlib.py
    index d0fabc8..746df48 100644
    a b class MathLib: 
    221221        elif type(n) is types.LongType:
    222222            n = self.d(n)
    223223        elif isinstance(n, Rational):
    224             n = self.d(float(n))
     224            n = self.d(Decimal(n.n) / Decimal(n.d))
    225225        elif not isinstance(n, Decimal):
    226226            return _('Error: unsupported type')
    227227