[squeak-dev] The Inbox: Kernel-nice.690.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sun May 20 13:56:40 UTC 2012


2012/5/20 Bert Freudenberg <bert at freudenbergs.de>:
>
> On 20.05.2012, at 14:54, David T. Lewis wrote:
>
>> Regarding this change:
>>
>>>> 2) Don't print arbitrary digits beyond Float precision, just print zeros
>>>> (0.1 printShowingDecimalPlaces: 20) now prints '0.10000000000000000000'
>>>> instead of '0.10000000000000000555',
>>>> Rationale: those digits, while reflecting internal representation exactly,
>>>> are totally insignificant and could be replaced with any other digits, while still representing the same Float.
>>
>> The rationale is correct, although a contrary argument might be that
>> the trailing '555' digits provide a visual cue as to floating point
>> precision. The visual reminder may be useful when mixing single and
>> double precision floats.
>>
>>  (FloatArray with: 0.1) first printShowingDecimalPlaces: 20
>>    ==> '0.10000000149011611938'
>>
>>  0.1 asFloat printShowingDecimalPlaces: 20
>>    ==> '0.10000000000000000555'
>>
>> Dave
>
>
> But
>
>        0.10000000000000000555 = 0.10000000000000000000
>
> What do you gain by showing the byproducts of the printing algorithm, which have nothing to do with the actual number?
>
> - Bert -
>

That's why I prefer scheme 0.10000000000000000###, but since this is
not a valid literal syntax, I didn't dare...

Nicolas

>
>


More information about the Squeak-dev mailing list