Peter,
On 2005 Feb 18 , at 10.52, Peter W. Draper wrote:
> Looks good, the Tru64 build progressed further. The remaining issues
> currently look like the oddities we're seeing elsewhere.
And I think I've fixed the last one (how dare ./dtask_link_adam produce
commas where I'm not expecting them!)
> You're right about the 17 significant places in double precision, but I
> still find it unsettling to see a number formatted differently to the
> system defined value (the thought that it is rubbish as well adds to
> this
> feeling).
Ditto.
> Looking at the statement that prints these values (symbolically) I
> think I
> can see what the problem is:
>
> printf( "#define %s %.*le\n", "VAL__BADD", 17, -DBL_MAX );
>
> it's that "e" format. The "17" in this case represents the number of
> decimal places, not the number of significant digits, so you get one
> extra
> place printed. I'd say you should really use the "g" format here. In
> that
> case the 17 is the number of significant figures. Of course "g" does
> other
> clever things, so there might be a surprise or two.
Yes, I was aware that this was printing one too many digits, but
thought that belt and braces would be harmless. But `it'll probably be
all right' isn't much of an argument.
OK, I'll take another look at the Numerical Computation Guide and see
if I can really understand the binary->decimal conversion well enough
to feel authoritative here. It's the `other clever things' that are
worrying.
See you,
Norman
--
----------------------------------------------------------------------
Norman Gray : Physics & Astronomy, Glasgow University, UK
http://www.astro.gla.ac.uk/users/norman/ : www.starlink.ac.uk
|