Comparing Fractions

sqrmax at cvtci.com.ar sqrmax at cvtci.com.ar
Mon Mar 23 21:43:31 UTC 1998


Hi.

Fraction implements #<, but not #>. This results in super > and so... for 
instance, what should take 15ms took about 2 minutes! Not funny at all! Check 
implementing #> like, for instance, this:

#> aNumber
	^(self < aNumber or: [self = aNumber]) not

The methods on #< and #= will take care of adapting and so.

Andres.





More information about the Squeak-dev mailing list