From: mschulter AT DOT value DOT net (M. Schulter) Newsgroups: comp.os.msdos.djgpp Subject: Re: pb with long double Date: 15 Aug 1997 18:53:35 GMT Organization: Value Net Internetwork Services Inc. Lines: 30 Message-ID: <5t28jf$5nl$1@vnetnews.value.net> References: <33F23B22 DOT 6710 AT cict DOT fr> <5t181c$psd AT freenet-news DOT carleton DOT ca> NNTP-Posting-Host: value.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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 ? 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)