diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 651b53e7164..f37e28a5efa 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,16 @@ +2009-05-15 David Billinghurst + + * testsuite/26_numerics/random/discrete_distribution/cons/num_xbound_fun.cc: + Replace non-standard macro M_PI with constant pi. + * testsuite/26_numerics/random/piecewise_constant_distribution/cons/initlist_fun.cc: + Likewise + * testsuite/26_numerics/random/piecewise_constant_distribution/cons/num_xbound_fun.cc: + Likewise + * testsuite/26_numerics/random/piecewise_linear_distribution/cons/initlist_fun.cc: + Likewise + * testsuite/26_numerics/random/piecewise_linear_distribution/cons/num_xbound_fun.cc: + Likewise + 2009-05-14 Paolo Carlini PR libstdc++/40123 diff --git a/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/cons/num_xbound_fun.cc b/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/cons/num_xbound_fun.cc index bab3609dbb6..49bb2b33061 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/cons/num_xbound_fun.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/cons/num_xbound_fun.cc @@ -39,8 +39,10 @@ struct cosine_distribution return 0.0; else if (x - _M_x0 > _M_lambda / 4) return 0.0; - else - return std::cos(2 * M_PI * (x - _M_x0) / _M_lambda); + else { + const double pi = 3.1415926535897932384626433832795029L; + return std::cos(2 * pi * (x - _M_x0) / _M_lambda); + } } private: diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/initlist_fun.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/initlist_fun.cc index 4c9a6e50975..54fadb9194d 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/initlist_fun.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/initlist_fun.cc @@ -39,8 +39,10 @@ struct cosine_distribution return 0.0; else if (x - _M_x0 > _M_lambda / 4) return 0.0; - else - return std::cos(2 * M_PI * (x - _M_x0) / _M_lambda); + else { + const double pi = 3.1415926535897932384626433832795029L; + return std::cos(2 * pi * (x - _M_x0) / _M_lambda); + } } private: diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/num_xbound_fun.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/num_xbound_fun.cc index 3234b080782..30a733ce621 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/num_xbound_fun.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/num_xbound_fun.cc @@ -39,8 +39,10 @@ struct cosine_distribution return 0.0; else if (x - _M_x0 > _M_lambda / 4) return 0.0; - else - return std::cos(2 * M_PI * (x - _M_x0) / _M_lambda); + else { + const double pi = 3.1415926535897932384626433832795029L; + return std::cos(2 * pi * (x - _M_x0) / _M_lambda); + } } private: diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/initlist_fun.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/initlist_fun.cc index 3f049896983..f1b24ea9149 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/initlist_fun.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/initlist_fun.cc @@ -39,8 +39,10 @@ struct cosine_distribution return 0.0; else if (x - _M_x0 > _M_lambda / 4) return 0.0; - else - return std::cos(2 * M_PI * (x - _M_x0) / _M_lambda); + else { + const double pi = 3.1415926535897932384626433832795029L; + return std::cos(2 * pi * (x - _M_x0) / _M_lambda); + } } private: diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/num_xbound_fun.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/num_xbound_fun.cc index b8b1a023f6c..f22b26e5278 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/num_xbound_fun.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/num_xbound_fun.cc @@ -39,8 +39,10 @@ struct cosine_distribution return 0.0; else if (x - _M_x0 > _M_lambda / 4) return 0.0; - else - return std::cos(2 * M_PI * (x - _M_x0) / _M_lambda); + else { + const double pi = 3.1415926535897932384626433832795029L; + return std::cos(2 * pi * (x - _M_x0) / _M_lambda); + } } private: