Accuracy of print_csrc_double

Richard B. Kreckel kreckel at thep.physik.uni-mainz.de
Mon Sep 23 16:55:37 CEST 2002


Hi Pearu,

On Sat, 21 Sep 2002, Pearu Peterson wrote:
> Is it possible to increase the accuracy of print_csrc_double output?

Not really.  The accuracy is actually maximal.   :-)

What happens is that the precision for type double of your ostream object
is set to 6 decimal digits, rather than 16 or 17.  Just call
`cout.precision(16)' before printing the expression.

> print_csrc_double in GiNaC-1.0.8 shows only 6 decimal digits but I would
> like to have at least 16 digits displayed. Is it possible?

Well, I am considering to bump up the precision to 16 decimal digits for
double output in `numeric::print()' before attaching the return value of
`numeric::to_double()' to the stream in question (i.e. `c.s') and
resetting it to the normal value afterwards.  I don't think this would
cause any side-effects, do you?

Regards
     -richy.
-- 
Richard B. Kreckel
<Richard.Kreckel at GiNaC.DE>
<http://www.ginac.de/~kreckel/>




More information about the GiNaC-list mailing list