[Bug?] Converting Float to Fraction

Bill Spight bspight at pacbell.net
Mon Feb 24 08:04:26 UTC 2003

Suppose we want to test whether a number is an integer. #isInteger tests
the *form* of the number, so 

    2 asFraction isInteger 

is false.

    2 asFraction reduced isInteger

is true.

Fine. The latter looks like our test.


    2.0 asFraction reduced isInteger

brings up the debugger. The reason is that

    2.0 asFraction isInteger

is true. It should be false, right?

(OTOH, if it should be true, then shouldn't Integer>>asFraction return
the receiver?)



More information about the Squeak-dev mailing list