[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Fractions bug

From: Stephen Compall
Subject: Re: [Help-smalltalk] Fractions bug
Date: Mon, 22 Jan 2007 01:11:40 -0600

On Sun, 2007-01-21 at 22:40 -0700, J Pfersich wrote:
> st> var5 printString !
> '3/4'
> st> var5 storeOn: stdout !
> (Fraction numerator: 3 denominator: 3)Fraction new "<0x1057dc0>"
> st>
> The numerator is also used as the denominator.

heh :)  See attachment.  (Paolo: fixed in
"fix wrong varref in Fraction>>#storeOn:".)

> I also found that the class comment is inaccurate, the arithmatic operators
> do not answer a reduced fraction, the reduce private method is never accessed.

See the category 'arithmetic' method bodies.

st> ((3/4) * (2/3)) inspect!
An instance of Fraction
  numerator: 1
  denominator: 2

;;; Stephen Compall ** **
"Peta" is Greek for fifth; a petabyte is 10 to the fifth power, as
well as fifth in line after kilo, mega, giga, and tera.
  -- Lee Gomes, performing every Wednesday in his tech column
     "Portals" on page B1 of The Wall Street Journal

Attachment: fraction-storeon.diff
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]