delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/05/00:46:42

Message-ID: <39DC061F.97DFBB0D@trollope.org>
From: Michael Powe <michael+netscape AT trollope DOT org>
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: problem with math.h
Lines: 20
Date: Wed, 04 Oct 2000 21:39:59 -0700
NNTP-Posting-Host: 207.240.204.75
X-Complaints-To: news AT aracnet DOT com
X-Trace: typhoon.aracnet.com 970720888 207.240.204.75 (Wed, 04 Oct 2000 21:41:28 PDT)
NNTP-Posting-Date: Wed, 04 Oct 2000 21:41:28 PDT
Organization: Aracnet Internet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,

I have a little something peculiar here.  I #included math.h in order to
use the PI macro.  However, compiling with 

gcc -Wall -ansi -pedantic ... -lm 

results in an error that `PI' is undeclared.  I can get rid of this
error and get gcc to compile the program by removing -ansi -pedantic
from the command line.

Looking in math.h, I see that the section in which PI is #defined is
preceded by #ifndef __STRICT_ANSI__ and #ifndef _POSIX_SOURCE.  

Does ANSI C exclude a value for PI?  Is there some reason why the
standard library should not provide one?

Thanks for any help.

mp

- Raw text -


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