Mantis Bugtracker

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005693 [Squeak] Kernel minor always 01-02-07 13:38 01-06-07 03:32
Reporter robdavid View Status public  
Assigned To
Priority normal Resolution open Platform
Status new   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 3.9
  Product Build
Summary 0005693: ScaledDecimal printString truncates rather than rounds, giving some surprising results.
Description When a floating point number is converted to ScaledDecimal, rounding erros can cause printString can give odd results, eg.

(1.23 asScaledDecimal:2) printString

gives "1.22s2"

Is this really what it should be doing?
Steps To Reproduce
Additional Information Questions over issue seem to have existed when ScaledDecimal was written; ScaledDecimalTest<<testPrintString contains the comment:

"The printed representation of a ScaledDecimal is truncated, not rounded.
Not sure if this is right, so this test describes the current Squeak implementation.
If someone knows a reason that rounding would be preferable, then update
this test."
Attached Files

- Relationships
related to 0006696assigned andreas ScaledDecimal can read in base 16 but cannot print in base 16 

- Notes
(0008839 - 350 - 392 - 578 - 578 - 578 - 578)
nicolas cellier
01-06-07 03:32

For information, both VW and Dolphin do a rounded print.
didn't see much about printString in the standard... ( [^]

Answer a string that is a valid literal representation that approximates the numeric value of the

Both rounding and truncating are compliant...

- Issue History
Date Modified Username Field Change
01-02-07 13:38 robdavid New Issue
01-06-07 03:32 nicolas cellier Note Added: 0008839
09-25-07 01:20 matthewf Relationship added related to 0006696

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
39 total queries executed.
31 unique queries executed.
Powered by Mantis Bugtracker