Re: How to "print" a "double" ?



Jean-Marc Bourguet wrote:
Xavier Roche <xroche@xxxxxxxxxxxxxxxxxxxxxx> writes:

If there is no other way, I suppose that "%.16lf" is the lesser evil, but
definitely not a clean solution.

%.16lg would be better as it won't round to 0 value below 5e-17.

For another possibility, consider using frexp() to split the
floating-point value into an integer exponent and a normalized
fraction and printing them separately.

--
Eric.Sosman@xxxxxxx
.



Relevant Pages

  • Re: florating point and VHDL
    ... If you really, really want floating-point hardware, there ... throw away the unused less-significant bits of the fraction, ... Jonathan Bromley, Consultant ... DOULOS - Developing Design Know-how ...
    (comp.lang.vhdl)
  • Re: a print bug?
    ... difficulties that inaccuracies in floating-point can create;-) ... the first version will favor the correct rounding, ... printing out as 1.2344999999999). ... so even if you round it off, it is still represented the same way.... ...
    (comp.lang.python)
  • Re: is order urgent doubt
    ... Because double double (using a pair of doubles to represent a single ... floating-point number) in the general case doesn't adhere to the ... to restrict the exponents to make the fraction bits contiguous rather ...
    (comp.lang.c)
  • Re: printing fractions
    ... > and the fraction is not printing out on the document. ... The fraction has a " mark after it to show that it ... Amedee Van Gasse using XanaNews 1.17.4.1 ...
    (microsoft.public.word.newusers)
  • Re: Fast Cube Root Using C33
    ... and a significand (or fraction). ... You divide the ... integer exponent, then use the remainder to improve the initial value. ...
    (comp.dsp)