[Pharo-project] Unexpected behavior of roundTo:

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Apr 8 20:19:00 CEST 2011


2011/4/8 Hilaire Fernandes <hilaire.fernandes at gmail.com>:
> Well, whatever the underneath representation, one can expect roundedTo:
> 2 to return a float with two decimals.
>
> I am only interested in roundedTo: to display in the DrGeo canvas
> numbers. It was still funny to see sometimes number with 10 digits.
>
> Thanks for the info.
>
>
> Hilaire
>

Previous versions were lying too by not printing a number that would
be reinterpreted into itself.
But if it is what you want, then you should use the old print message,
#absPrintOn:base:
Maybe it could be wrapped into a printApproximatelyOn: to be
polymorphic with other numbers ?

Nicolas

> --
> Education 0.2 -- http://blog.ofset.org/hilaire
>
>
>



More information about the Pharo-project mailing list