Re: [PATCH] use "%Le" to display floats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 25, 2018 at 10:10:16PM +0100, Ramsay Jones wrote:
> 
> 
> On 25/06/18 20:05, Luc Van Oostenryck wrote:
> > Floating-point values are displayed using the printf
> > format "%Lf" but this is the format without exponent
> > (and with default precision of 6 digit).
> > 
> > However, by its nature, this format is very imprecise.
> > For example, *all* values smaller than 0.5e-6 are displayed
> > as "0.000000".
> > 
> > Improve this by using the "%Le" format which always use
> > an exponent and thus maximize the precision.
> 
> Did you consider the "%Lg" format?

Yes, I tried it before %Le because it's the 'g' format I was
used to when I had to display some floating-point value but
here I prefer the 'e' format in order to have the exact same
'd.dddddde±dd' for all values. In particular I like to always
have a decimal point present (not that it matters much, though).

-- Luc
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux