Ticket #3363: 0001-Fix-error-in-Rational-division.patch

File 0001-Fix-error-in-Rational-division.patch, 773 bytes (added by miguelgarcia, 12 years ago)

patch for rational division

  • rational.py

    From c069c27df4c172ce90ff49370d8681255f0214e3 Mon Sep 17 00:00:00 2001
    From: Miguel Garcia <miguel.garcia@gmail.com>
    Date: Tue, 13 Mar 2012 04:30:41 -0300
    Subject: [PATCH] Fix error in Rational division
    
    ---
     rational.py |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/rational.py b/rational.py
    index 34b298f..f99f610 100644
    a b class Rational: 
    113113
    114114    def __div__(self, rval):
    115115        if isinstance(rval, Rational):
    116             ret = Rational(self.d * rval.d, self.n * rval.n)
     116            ret = Rational(self.n * rval.d, self.d * rval.n)
    117117        elif type(rval) is types.IntType or type(rval) is types.LongType:
    118118            ret = Rational(self.n, self.d * rval)
    119119        else: