Article View: comp.std.c
Article #38Re: Lack of mathematical constants in (ANSI) <math.h>
From: J. D. McDonald
Date: Fri, 30 Oct 1992 14:25
Date: Fri, 30 Oct 1992 14:25
27 lines
1816 bytes
1816 bytes
In article <1992Oct30.010005.18407@alchemy.chem.utoronto.ca> mroussel@alchemy.chem.utoronto.ca (Marc Roussel) writes: >In article <Bww9oA.LJI@NCoast.ORG> brown@NCoast.ORG (Stan Brown) writes: >>>M_PI, M_PI_2, M_PI_4, M_SQRT2, M_E, M_LOG2E, M_LOG10E, M_LN2, M_LN10 >> >>I question this. Perhaps in the particular compiler you were using >>those constants were defined, but I don't recall anything resembling >>them in _any_ C compiler I've ever used. > For the record, these things are in the HP-UX, Sun S5R2, Apollo >ANSI/XOPEN and Borland Turbo C++ versions of math.h. Can anyone name a >recent compiler whose math.h does NOT include these? (I'm satisfied >even if they are buried under an #ifdef.) Certainly: they are in none of the C compilers I have: Microsoft C 5.1 and MicroWay C. In fact, I have **never** seen them in any compiler I have ever used. The MicroWay non-ANSI math.h has a PI and a LIBM_PI but none of the ones you mention. However, I never use that one, as I use ANSI C. I would object very strongly if they were in any math.h file unless buried under a #if __something (the leading underscores are necessary to make it a legal ANSI C compiler. Doug McDonald
Technical Details
Message-ID:
<mcdonald.455@aries.scs.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!aries.scs.uiuc.edu!mcdonaldReferences:
<BwMt54.D5I@NCoast.ORG> <BwtHFu.qs@research.canon.oz.au> <Bww9oA.LJI@NCoast.ORG> <1992Oct30.010005.18407@alchemy.chem.utoronto.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c,comp.lang.c Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!aries.scs.uiuc.edu!mcdonald From: mcdonald@aries.scs.uiuc.edu (J. D. McDonald) Subject: Re: Lack of mathematical constants in (ANSI) <math.h> References: <BwMt54.D5I@NCoast.ORG> <BwtHFu.qs@research.canon.oz.au> <Bww9oA.LJI@NCoast.ORG> <1992Oct30.010005.18407@alchemy.chem.utoronto.ca> Message-ID: <mcdonald.455@aries.scs.uiuc.edu> Sender: usenet@news.cso.uiuc.edu (Net Noise owner) Organization: UIUC SCS Date: Fri, 30 Oct 1992 14:25:02 GMT Lines: 27