Printing Floats

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Printing Floats

Ian Bartholomew-3
The DefSigFigs value in D5 has been changed to 16 (from 15 in D4).  This can
have unpleasant results for some values -

94.6 printString now answers  '94.59999999999999'

(94.6 roundTo: 0.01) printString now answers '94.60000000000001'

In D4 they both answer '94.6'

Regards
    Ian


Reply | Threaded
Open this post in threaded view
|

Re: Printing Floats

Blair McGlashan
"Ian Bartholomew" <[hidden email]> wrote in message
news:[hidden email]...
> The DefSigFigs value in D5 has been changed to 16 (from 15 in D4).  This
can
> have unpleasant results for some values -
>
> 94.6 printString now answers  '94.59999999999999'
>
> (94.6 roundTo: 0.01) printString now answers '94.60000000000001'
>
> In D4 they both answer '94.6'

Thanks Ian, #678.

Blair