ScaledDecimal scale coercion

nicolas cellier ncellier at ifrance.com
Sat Jul 29 02:01:29 UTC 2006


Hello
I noticed that in Squeak, the scale is inherited from receiver:

  (0.5s1*0.5s2)  -> 0.2s1
  (0.5s2*0.5s1) -> 0.25s2

in VW, it is coerced to the larger scale (also do gst and stx):

  (0.5s1*0.5s2) -> 0.25s
  (0.5s2*0.5s1) -> 0.25s

Also, the storeString is not retrieving original object but truncate as 
printString would do:

  (Number readFrom: (0.5s1*0.5s1) storeString) = (0.5s1*0.5s1).
  (Compiler evaluate: (0.5s1*0.5s1) storeString) = (0.5s1*0.5s1).

VW has the same bug with:

  (0.5s1 squared storeOn: Transcript). Transcript flush

except it rounds instead of truncating.

Is this expected / ANSI / standard / bugged ?

Nicolas





More information about the Squeak-dev mailing list