[BUG][POSSIBLE FIXES]
Andrew C. Greenberg
werdna at gate.net
Mon Oct 4 10:58:23 UTC 1999
>I think implementing #grid: in Number (like in Point) would solve this,
>and #roundTo: should be fixed to always return an Integer, independent of
>the argument's class. Maybe the argument should be sent #asInteger,
>since "(200 roundTo: 3.14) = 157" isn't really useful, although this
>really is the "next integer multiple of 3.14"?
My daughter has spent the last year being tormented by teachers
asking her to round things to the nearest tenth. Another example is
money after an interest computation, where you might regularly ask:
(...expr...) roundTo: 0.01
remembering that if we are using such a thing in a series of
computations, we probably want to keep an accumulated sum and then
subtract to arrive at our last result (or assign the remaining
fractional penny to a "special" account :-)).
More information about the Squeak-dev
mailing list
|