[Pharo-project] SIXX problem for ScaledDecimal

Chris Cunningham cunningham.cb at gmail.com
Fri May 20 00:34:11 CEST 2011


For ScaledDecimal, SIXX should definite store it as the underlying
fraction.  Storing it in the printed fashion does change the value of
the ScaledDecimal.

(1/3) asScaledDecimal: 2  gives  0.33s2
and
(33/100) asScaledDecimal: 2  gives  0.33s2
yet
0.33s2 ~= ( (1/3) asScaledDecimal: 2 )
and
( (1/3) asScaledDecimal: 2 ) ~= ( (33/100) asScaledDecimal: 2 )

In other words, the ScaledDecimal is about the precise internal number
and the scale to display it - which is NOT the scale that it is stored
as.

-Chris



More information about the Pharo-project mailing list