On 03.07.2013, at 13:56, [email protected] wrote:

> In Squeak 4.3 I print "(7/5) roundTo: 0.01" and get "1.4"
> however,
> In Squeak 4.4 I print "(7/5) roundTo: 0.01" and get "1.4000000000000001"
> 
> Am I doing something to cause this change? Or, is this the result of 
> inflation :)

No, it's the result of more precise Float printing. Consider this:

((7/5) roundTo: 0.01) = 1.4
==> false

((7/5) roundTo: 0.01) = 1.4000000000000001
==> true


For printing with a reduced precision you should not use roundTo but this:

7/5 printShowingDecimalPlaces: 2
==> '1.40'

7/5 printShowingMaxDecimalPlaces: 2
==> '1.4'

- Bert -


_______________________________________________
Beginners mailing list
[email protected]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to