Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002187 [Squeak] System block always 11-14-05 09:22 12-19-05 15:51
Reporter pmm View Status public  
Assigned To
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.9 Product Version 3.8
  Product Build
Summary 0002187: Utilites class >> #floatPrecisionForDecimalPlaces: doesn't work for arguments bigger than 9
Description It's obvious Utilites class >> #floatPrecisionForDecimalPlaces: works only for arguments between 0 and 9.

The following code (attached) should this:
<code>floatPrecisionForDecimalPlaces: places
    "Answer the floatPrecision that corresponds to the given number of decimal places"
    ^places <= 9
        ifTrue: [ #(1 0.1 0.01 0.001 0.0001 0.00001 0.000001 0.0000001 0.00000001 0.000000001) at: (places + 1) ]
        ifFalse: [ (10 raisedTo: places negated) asFloat ]

"
(0 to: 12) collect: [:i | Utilities floatPrecisionForDecimalPlaces: i]
"</code>
Steps To Reproduce
Additional Information
Attached Files  Utilities class-floatPrecisionForDecimalPlaces.st [^] (547 bytes) 11-14-05 09:22

- Relationships
related to 0000150closed  Number>>printShowingDecimalPlaces: output incorrect 

- Notes
(0003242 - 66 - 78 - 202 - 202 - 202 - 202)
pmm
12-09-05 11:50

duplicate of:
http://bugs.impara.de/view.php?id=150 [^]
please close
 
(0003356 - 16 - 16 - 16 - 16 - 16 - 16)
ducasse
12-19-05 15:51

duplicate of 150
 

- Issue History
Date Modified Username Field Change
11-14-05 09:22 pmm New Issue
11-14-05 09:22 pmm File Added: Utilities class-floatPrecisionForDecimalPlaces.st
12-09-05 11:50 pmm Note Added: 0003242
12-19-05 15:51 ducasse Relationship added related to 0000150
12-19-05 15:51 ducasse Status new => closed
12-19-05 15:51 ducasse Note Added: 0003356
12-19-05 15:51 ducasse Resolution open => fixed
12-19-05 15:51 ducasse Fixed in Version  => 3.9


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