delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/17/05:49:30

From: Gesam <vsamou AT cict DOT fr>
Newsgroups: comp.os.msdos.djgpp
Subject: pb with long double
Date: Thu, 14 Aug 1997 00:54:26 +0200
Lines: 21
Message-ID: <33F23B22.6710@cict.fr>
NNTP-Posting-Host: vsamou.cict.fr
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I am a french student and I have little problem with GCC
Here is my program :

#include <math.h>
main()
{
 long double a;
 a=PI;
 printf("%22.20Lf",a);
}

After I use GCC : gcc myprog.c -o myprog.exe -lm 
The result is 3.14159265358979311600 
                               wrong
There is only 15 good digits instead of 19 
( PI is defined with more than 20 digits im math.h )

With Borland Turbo C this problem doesn't exist ; there is 
19 good digits. 

Could you help me ?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019