C++ output precision

Helmut Jarausch jarausch at skynet.be
Sat Mar 3 13:13:41 CET 2007


Hi,

I'm using gmp-2.4.1 with all official patches.
I'm using the C++ interface which seems to work just fine.

Still, I haven't found out how to output a result with a given
number of digits.

I've tried

cout << setprecision(100) << mygmpresult << endl;

but it outputs always the same number of digits (21).
I've called mpf_set_default_prec(1000) before,
so there must be more digits internally.

What am I missing?

Many thanks for a hint,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany


More information about the gmp-discuss mailing list