[squeak-dev] ScaledDecimal newFromNumber: 0.0 scale: 0 can't print

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Sep 7 11:32:20 UTC 2011


Isn't it also the case with (ScaledDecimal newFromNumber: 1.0 scale: 0) ?

2011/9/7 Frank Shearar <frank.shearar at gmail.com>:
> Evaluate the following:
>
> 0s0 "=> 0s0"
> ScaledDecimal newFromNumber: 0 scale: 0 "=> 0s0"
>
> 0.0s0 "=> 0s0"
> ScaledDecimal newFromNumber: 0.0 scale: 0 "=> MNU: SmallInteger
> doesn't understand printTruncatedOn:showingDecimalPlaces:"
>
> The MNU happens because in ScaledDecimal class >> #newFromNumber:scale: we say
>
>    "..." aNumber asFraction "..."
>
> and when aNumber = 0.0, aNumber asFraction = 0, which is a
> SmallInteger and not a Fraction.
>
> (Recorded as http://bugs.squeak.org/view.php?id=7667)
>
> frank
>
>



More information about the Squeak-dev mailing list