Bug in Float printOn:decimalPlaces:

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

Bug in Float printOn:decimalPlaces:

Bill Dargel
Just a little bug I found in Float printOn:decimalPlaces: in Dolphin
4.01.3.

Doing
    3.999 printOn: aStream decimalPlaces: 2
produces '4.00', and
    3.999 printOn: aStream decimalPlaces: 1
produces '4.0', *but*
    3.999 printOn: aStream decimalPlaces: 0
produces '3'.

A fix is to change the "self truncated" to "self rounded" for the case
where decimalPlaces aInteger < 1.

-------------------------------------------
Bill Dargel            [hidden email]
Shoshana Technologies
100 West Joy Road, Ann Arbor, MI 48105  USA


Reply | Threaded
Open this post in threaded view
|

Re: Bug in Float printOn:decimalPlaces:

Blair McGlashan
Bill

You wrote in message news:[hidden email]...

> Just a little bug I found in Float printOn:decimalPlaces: in Dolphin
> 4.01.3.
>
> Doing
>     3.999 printOn: aStream decimalPlaces: 2
> produces '4.00', and
>     3.999 printOn: aStream decimalPlaces: 1
> produces '4.0', *but*
>     3.999 printOn: aStream decimalPlaces: 0
> produces '3'.
>
> A fix is to change the "self truncated" to "self rounded" for the case
> where decimalPlaces aInteger < 1.

Thanks, recorded as defect number 373 for correction in the next release.

Regards

Blair