Sep 07, 2010 - 05:09 AM
Home page - Submit News - Web links - FAQ 
Search 
Rational Less Than Posted by : cf
Algorithm/Data Structure Question Compute "less than" for a rational number class.
Rational Less Than | Log-in or register a new user account | 1 Comment
Comments are statements made by the person that posted them.
They do not necessarily represent the opinions of the site editor.

If Integer Overflows are of No Concern

(Score: 1)
by cf (cf@mannby.nospam.com) on Jun 06, 2004 - 01:27 AM
(User information  | Send a message http://www.mannby.com)
From Squeak Smalltalk v. 3.6:

< aNumber
   aNumber isFraction ifTrue:
      [^ numerator * aNumber denominator < (aNumber numerator * denominator)].
   ^ aNumber adaptToFraction: self andSend: #<

Mind+ | Mannby | Niru's Art