This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Some uses of M_PI in libstdc++ testsuite


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]