This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Some uses of M_PI in libstdc++ testsuite
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: David Billinghurst <dbcygwin at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org, patches at gcc dot gnu dot org
- Date: Thu, 14 May 2009 14:45:22 +0200
- Subject: Re: [PATCH] Some uses of M_PI in libstdc++ testsuite
- References: <4A0BF945.1070603@gmail.com> <4A0C115D.4020900@oracle.com>
Paolo Carlini wrote:
> David Billinghurst wrote:
>
>> Following http://gcc.gnu.org/ml/libstdc++/2009-05/msg00091.html there
>> are a couple of uses of M_PI in the libstdc++ testsuite. Defining M_PI
>> seems safe, as these are testsuite cases.
>>
> Nope, let's not fiddle with M_PI, which is not standard: some people may
> be fooled again into thinking this is a portable macro. Let's have
> instead an unconditional:
>
> #define _Pi 3.1415926535897932384626433832795029L
>
Alternately, maybe even more consistent with the rest of the testsuite,
let's avoid macros completely and have just, right before the current
uses of M_PI:
const double __pi = 3.1415926535897932384626433832795029L;
or
const long double __pi = 3.1415926535897932384626433832795029L;
depending on the specific use.
Paolo.