|
From: | J Pfersich |
Subject: | Re: [Help-smalltalk] Fractions bug |
Date: | Tue, 23 Jan 2007 22:26:57 -0700 |
Sorry, I didn't include the example, so here it is: st> var5 := Fraction numerator: 123 denominator: 3 ! Fraction new "<0x1041b08>" st> var5 printNl ! 123/3 Fraction new "<0x1041b08>" st> (var5 * (Fraction numerator: 1 denominator: 1)) printNl ! 123/3 Fraction new "<0x104d998>" st> (var5 * (Fraction numerator: 2 denominator: 1)) printNl ! 246/3 At 09:40 AM 1/22/2007 +0100, Paolo Bonzini wrote:
I also found that the class comment is inaccurate, the arithmatic operatorsdo not answer a reduced fraction, the reduce private method is never accessed.Please verify your assertions, as you obviously did (instead) for the #storeOn: bug which is real. #reduce is never called because the arithmetic operators compute gcd's on their own for speed.st> ^(3/4)+(1/4) st> ! 1 Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |