Mail Archives: djgpp/1997/08/15/20:04:40
Paul Derbyshire (ao950 AT FreeNet DOT Carleton DOT CA) wrote:
: Gesam (vsamou AT cict DOT fr) writes:
: > After I use GCC : gcc myprog.c -o myprog.exe -lm
: > The result is 3.14159265358979311600
:
: Funny, I count 19 here. Plus those two zeros.
But are they the _right_ 19 digits <grin>?
Pi: 3.14159265358979323846
Result (as double): 3.14159265358979311600
Result (as long double): 3.14159265358979323851
Note that the first 16 digits in our original poster's example are correct
(as one might expect for a double), but the rest differ.
As I noted in a previous message, when pi is defined as a long double with
a suffix 'L', it comes out accurate to 19 digits with GCC, although the
last two digits differ, as we might expect even in the case of a long
double.
Most respectfully,
Margo Schulter
mschulter AT value DOT net
(To reply, please remove the extra . in my default address)
- Raw text -