This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Minor tweaks to the <random> testcases
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 15 May 2009 12:06:56 +0200
- Subject: [v3] Minor tweaks to the <random> testcases
Hi,
tested x86_64-linux, committed to mainline.
Paolo.
/////////////////////
2009-05-15 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/26_numerics/random/discrete_distribution/cons/
num_xbound_fun.cc: Minor tweaks.
* 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
Index: testsuite/26_numerics/random/piecewise_constant_distribution/cons/num_xbound_fun.cc
===================================================================
--- testsuite/26_numerics/random/piecewise_constant_distribution/cons/num_xbound_fun.cc (revision 147565)
+++ testsuite/26_numerics/random/piecewise_constant_distribution/cons/num_xbound_fun.cc (working copy)
@@ -19,7 +19,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 26.4.8.5.2 Class template piecewise_constant_distribution [rand.dist.samp.pconst]
+// 26.4.8.5.2 Class template piecewise_constant_distribution
+// [rand.dist.samp.pconst]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
@@ -39,10 +40,11 @@
return 0.0;
else if (x - _M_x0 > _M_lambda / 4)
return 0.0;
- else {
- const double pi = 3.1415926535897932384626433832795029L;
- return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
- }
+ else
+ {
+ const double pi = 3.14159265358979323846;
+ return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
+ }
}
private:
Index: testsuite/26_numerics/random/piecewise_constant_distribution/cons/initlist_fun.cc
===================================================================
--- testsuite/26_numerics/random/piecewise_constant_distribution/cons/initlist_fun.cc (revision 147565)
+++ testsuite/26_numerics/random/piecewise_constant_distribution/cons/initlist_fun.cc (working copy)
@@ -19,7 +19,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 26.4.8.5.2 Class template piecewise_constant_distribution [rand.dist.samp.pconst]
+// 26.4.8.5.2 Class template piecewise_constant_distribution
+// [rand.dist.samp.pconst]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
@@ -39,10 +40,11 @@
return 0.0;
else if (x - _M_x0 > _M_lambda / 4)
return 0.0;
- else {
- const double pi = 3.1415926535897932384626433832795029L;
- return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
- }
+ else
+ {
+ const double pi = 3.14159265358979323846;
+ return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
+ }
}
private:
Index: testsuite/26_numerics/random/discrete_distribution/cons/num_xbound_fun.cc
===================================================================
--- testsuite/26_numerics/random/discrete_distribution/cons/num_xbound_fun.cc (revision 147565)
+++ testsuite/26_numerics/random/discrete_distribution/cons/num_xbound_fun.cc (working copy)
@@ -39,10 +39,11 @@
return 0.0;
else if (x - _M_x0 > _M_lambda / 4)
return 0.0;
- else {
- const double pi = 3.1415926535897932384626433832795029L;
- return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
- }
+ else
+ {
+ const double pi = 3.14159265358979323846;
+ return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
+ }
}
private:
Index: testsuite/26_numerics/random/piecewise_linear_distribution/cons/num_xbound_fun.cc
===================================================================
--- testsuite/26_numerics/random/piecewise_linear_distribution/cons/num_xbound_fun.cc (revision 147565)
+++ testsuite/26_numerics/random/piecewise_linear_distribution/cons/num_xbound_fun.cc (working copy)
@@ -19,7 +19,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 26.4.8.5.3 Class template piecewise_linear_distribution [rand.dist.samp.plinear]
+// 26.4.8.5.3 Class template piecewise_linear_distribution
+// [rand.dist.samp.plinear]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
@@ -39,10 +40,11 @@
return 0.0;
else if (x - _M_x0 > _M_lambda / 4)
return 0.0;
- else {
- const double pi = 3.1415926535897932384626433832795029L;
- return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
- }
+ else
+ {
+ const double pi = 3.14159265358979323846;
+ return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
+ }
}
private:
Index: testsuite/26_numerics/random/piecewise_linear_distribution/cons/initlist_fun.cc
===================================================================
--- testsuite/26_numerics/random/piecewise_linear_distribution/cons/initlist_fun.cc (revision 147565)
+++ testsuite/26_numerics/random/piecewise_linear_distribution/cons/initlist_fun.cc (working copy)
@@ -19,7 +19,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 26.4.8.5.3 Class template piecewise_linear_distribution [rand.dist.samp.plinear]
+// 26.4.8.5.3 Class template piecewise_linear_distribution
+// [rand.dist.samp.plinear]
// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
#include <random>
@@ -39,10 +40,11 @@
return 0.0;
else if (x - _M_x0 > _M_lambda / 4)
return 0.0;
- else {
- const double pi = 3.1415926535897932384626433832795029L;
- return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
- }
+ else
+ {
+ const double pi = 3.14159265358979323846;
+ return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
+ }
}
private: