[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Default Floating Point Format Specifiers
- From: Paige DePol <lual@...>
- Date: Thu, 3 Jul 2014 13:36:06 -0500
On Jul 3, 2014, at 6:09 AM, Luiz Henrique de Figueiredo <email@example.com> wrote:
>> The problem, according to the IEEE floating point entries on Wikipedia, is that there are not enough digits specified.
> This is on purpose so that numbers appear right for the casual user:
> We don't want needless noise when using print (and other automatic
> conversions via tostring). If you need round-trip strings, then use
Ah, well that is a great reason to not specify larger format specifiers, I didn't realise 0.1 would turn into 0.10000000000000001 with a larger specifier. When I was reading about specifier digits I did not find any information on this side-effect.
Thank you for the feedback on this matter Luiz, it is appreciated! I think by default I will simply pass through the original number format, and if someone wants to convert numbers I can use my own format specifiers instead of the default ones.