diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-08-07 11:41:30 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-08-07 11:41:30 +0000 |
commit | a803975d9c048465bb1e314b9b65eda45170cdf9 (patch) | |
tree | fe7ef552156ce5504151b03de08869532aca4429 /libstdc++-v3 | |
parent | dd81965b766c8465c2eec3ae4563f0076a899f8d (diff) | |
download | gcc-a803975d9c048465bb1e314b9b65eda45170cdf9.zip gcc-a803975d9c048465bb1e314b9b65eda45170cdf9.tar.gz gcc-a803975d9c048465bb1e314b9b65eda45170cdf9.tar.bz2 |
re PR libstdc++/58098 (wrong return value of normal_distribution::min())
2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/58098
* include/bits/random.h (cauchy_distribution<>::min,
extreme_value_distribution<>::min, normal_distribution<>::min,
student_t_distribution<>::min): Fix.
* include/ext/random (normal_mv_distribution<>::min): Likewise.
* testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc:
Adjust.
testsuite/26_numerics/random/cauchy_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/extreme_value_distribution/cons/
parms.cc: Likewise.
testsuite/26_numerics/random/extreme_value_distribution/cons/
default.cc: Likewise.
* testsuite/26_numerics/random/normal_distribution/cons/parms.cc:
Likewise.
* testsuite/26_numerics/random/normal_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/student_t_distribution/cons/parms.cc:
Likewise.
* testsuite/26_numerics/random/student_t_distribution/cons/default.cc:
Likewise.
* testsuite/ext/random/normal_mv_distribution/cons/parms.cc: Likewise.
* testsuite/ext/random/normal_mv_distribution/cons/default.cc: Likewise.
* testsuite/26_numerics/random/exponential_distribution/cons/parms.cc:
Minor tweak.
* testsuite/26_numerics/random/exponential_distribution/cons/default.cc:
Likewise.
* testsuite/ext/von_mises_distribution/*: Move to...
* testsuite/ext/random/von_mises_distribution/*: ... here.
* testsuite/ext/triangular_distribution/*: Move to...
* testsuite/ext/random/triangular_distribution/*: ... here.
From-SVN: r201562
Diffstat (limited to 'libstdc++-v3')
29 files changed, 55 insertions, 19 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 40d569e..174bfeb 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,39 @@ +2013-08-07 Paolo Carlini <paolo.carlini@oracle.com> + + PR libstdc++/58098 + * include/bits/random.h (cauchy_distribution<>::min, + extreme_value_distribution<>::min, normal_distribution<>::min, + student_t_distribution<>::min): Fix. + * include/ext/random (normal_mv_distribution<>::min): Likewise. + * testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc: + Adjust. + testsuite/26_numerics/random/cauchy_distribution/cons/default.cc: + Likewise. + * testsuite/26_numerics/random/extreme_value_distribution/cons/ + parms.cc: Likewise. + testsuite/26_numerics/random/extreme_value_distribution/cons/ + default.cc: Likewise. + * testsuite/26_numerics/random/normal_distribution/cons/parms.cc: + Likewise. + * testsuite/26_numerics/random/normal_distribution/cons/default.cc: + Likewise. + * testsuite/26_numerics/random/student_t_distribution/cons/parms.cc: + Likewise. + * testsuite/26_numerics/random/student_t_distribution/cons/default.cc: + Likewise. + * testsuite/ext/random/normal_mv_distribution/cons/parms.cc: Likewise. + * testsuite/ext/random/normal_mv_distribution/cons/default.cc: Likewise. + + * testsuite/26_numerics/random/exponential_distribution/cons/parms.cc: + Minor tweak. + * testsuite/26_numerics/random/exponential_distribution/cons/default.cc: + Likewise. + + * testsuite/ext/von_mises_distribution/*: Move to... + * testsuite/ext/random/von_mises_distribution/*: ... here. + * testsuite/ext/triangular_distribution/*: Move to... + * testsuite/ext/random/triangular_distribution/*: ... here. + 2013-08-06 Caroline Tice <cmtice@google.com> * fragment.am: Add XTEMPLATE_FLAGS. diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h index bf7f32f..dde2dd4 100644 --- a/libstdc++-v3/include/bits/random.h +++ b/libstdc++-v3/include/bits/random.h @@ -2178,7 +2178,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ result_type min() const - { return std::numeric_limits<result_type>::min(); } + { return std::numeric_limits<result_type>::lowest(); } /** * @brief Returns the least upper bound value of the distribution. @@ -3011,7 +3011,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ result_type min() const - { return std::numeric_limits<result_type>::min(); } + { return std::numeric_limits<result_type>::lowest(); } /** * @brief Returns the least upper bound value of the distribution. @@ -3428,7 +3428,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ result_type min() const - { return std::numeric_limits<result_type>::min(); } + { return std::numeric_limits<result_type>::lowest(); } /** * @brief Returns the least upper bound value of the distribution. @@ -5136,7 +5136,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ result_type min() const - { return std::numeric_limits<result_type>::min(); } + { return std::numeric_limits<result_type>::lowest(); } /** * @brief Returns the least upper bound value of the distribution. diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random index 5f365e6..347ebed 100644 --- a/libstdc++-v3/include/ext/random +++ b/libstdc++-v3/include/ext/random @@ -791,7 +791,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION result_type min() const { result_type __res; - __res.fill(std::numeric_limits<_RealType>::min()); + __res.fill(std::numeric_limits<_RealType>::lowest()); return __res; } /** diff --git a/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/default.cc index 37455ce..2a3465b 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/default.cc @@ -35,7 +35,7 @@ test01() VERIFY( u.a() == 0.0 ); VERIFY( u.b() == 1.0 ); typedef std::cauchy_distribution<>::result_type result_type; - VERIFY( u.min() == std::numeric_limits<result_type>::min() ); + VERIFY( u.min() == std::numeric_limits<result_type>::lowest() ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc index 2ac096b..67fb171 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/parms.cc @@ -35,7 +35,7 @@ test01() VERIFY( u.a() == 5.0 ); VERIFY( u.b() == 2.0 ); typedef std::cauchy_distribution<>::result_type result_type; - VERIFY( u.min() == std::numeric_limits<result_type>::min() ); + VERIFY( u.min() == std::numeric_limits<result_type>::lowest() ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/default.cc index 486a1b2..f84b130 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/default.cc @@ -34,7 +34,7 @@ test01() std::exponential_distribution<> u; VERIFY( u.lambda() == 1.0 ); typedef std::exponential_distribution<>::result_type result_type; - VERIFY( u.min() == 0 ); + VERIFY( u.min() == 0.0 ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/parms.cc b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/parms.cc index d1fc4dc..ef2decf 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/parms.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/parms.cc @@ -34,7 +34,7 @@ test01() std::exponential_distribution<> u(0.5); VERIFY( u.lambda() == 0.5 ); typedef std::exponential_distribution<>::result_type result_type; - VERIFY( u.min() == 0 ); + VERIFY( u.min() == 0.0 ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc index a8845e4..c14c49c 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc @@ -35,7 +35,7 @@ test01() VERIFY( u.a() == 0.0 ); VERIFY( u.b() == 1.0 ); typedef std::extreme_value_distribution<>::result_type result_type; - VERIFY( u.min() == std::numeric_limits<result_type>::min() ); + VERIFY( u.min() == std::numeric_limits<result_type>::lowest() ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/parms.cc b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/parms.cc index daa20b5..786847f 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/parms.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/parms.cc @@ -35,7 +35,7 @@ test01() VERIFY( u.a() == 5.0 ); VERIFY( u.b() == 2.0 ); typedef std::extreme_value_distribution<>::result_type result_type; - VERIFY( u.min() == std::numeric_limits<result_type>::min() ); + VERIFY( u.min() == std::numeric_limits<result_type>::lowest() ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/default.cc index 2ffa330..8beb8bd 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/default.cc @@ -35,7 +35,7 @@ test01() VERIFY( u.mean() == 0.0 ); VERIFY( u.stddev() == 1.0 ); typedef std::normal_distribution<>::result_type result_type; - VERIFY( u.min() == std::numeric_limits<result_type>::min() ); + VERIFY( u.min() == std::numeric_limits<result_type>::lowest() ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/parms.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/parms.cc index 0c2b799..ea87162 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/parms.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/parms.cc @@ -35,7 +35,7 @@ test01() VERIFY( u.mean() == 5.0 ); VERIFY( u.stddev() == 2.0 ); typedef std::normal_distribution<>::result_type result_type; - VERIFY( u.min() == std::numeric_limits<result_type>::min() ); + VERIFY( u.min() == std::numeric_limits<result_type>::lowest() ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/default.cc index 8318b37..0b5b8fa 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/default.cc @@ -34,7 +34,7 @@ test01() std::student_t_distribution<> u; VERIFY( u.n() == 1.0 ); typedef std::student_t_distribution<>::result_type result_type; - VERIFY( u.min() == std::numeric_limits<result_type>::min() ); + VERIFY( u.min() == std::numeric_limits<result_type>::lowest() ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/parms.cc b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/parms.cc index fb3dc05..1b99962 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/parms.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/parms.cc @@ -34,7 +34,7 @@ test01() std::student_t_distribution<> u(1.5); VERIFY( u.n() == 1.5 ); typedef std::student_t_distribution<>::result_type result_type; - VERIFY( u.min() == std::numeric_limits<result_type>::min() ); + VERIFY( u.min() == std::numeric_limits<result_type>::lowest() ); VERIFY( u.max() == std::numeric_limits<result_type>::max() ); } diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc index db3db48..80ad819 100644 --- a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc @@ -36,9 +36,9 @@ test01() VERIFY( u.varcov()[1] == 0.0 ); VERIFY( u.varcov()[2] == 1.0 ); typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type; - VERIFY( u.min()[0] == std::numeric_limits<result_type::value_type>::min() ); + VERIFY( u.min()[0] == std::numeric_limits<result_type::value_type>::lowest() ); VERIFY( u.max()[0] == std::numeric_limits<result_type::value_type>::max() ); - VERIFY( u.min()[1] == std::numeric_limits<result_type::value_type>::min() ); + VERIFY( u.min()[1] == std::numeric_limits<result_type::value_type>::lowest() ); VERIFY( u.max()[1] == std::numeric_limits<result_type::value_type>::max() ); } diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/parms.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/parms.cc index b546d07..3c51e7d 100644 --- a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/parms.cc +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/parms.cc @@ -36,9 +36,9 @@ test01() VERIFY( u.varcov()[1] == 0.0 ); VERIFY( u.varcov()[2] == 3.0 ); typedef __gnu_cxx::normal_mv_distribution<2>::result_type result_type; - VERIFY( u.min()[0] == std::numeric_limits<result_type::value_type>::min() ); + VERIFY( u.min()[0] == std::numeric_limits<result_type::value_type>::lowest() ); VERIFY( u.max()[0] == std::numeric_limits<result_type::value_type>::max() ); - VERIFY( u.min()[1] == std::numeric_limits<result_type::value_type>::min() ); + VERIFY( u.min()[1] == std::numeric_limits<result_type::value_type>::lowest() ); VERIFY( u.max()[1] == std::numeric_limits<result_type::value_type>::max() ); } diff --git a/libstdc++-v3/testsuite/ext/triangular_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/default.cc index 63303f8..63303f8 100644 --- a/libstdc++-v3/testsuite/ext/triangular_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/default.cc diff --git a/libstdc++-v3/testsuite/ext/triangular_distribution/cons/parms.cc b/libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/parms.cc index 8380965..8380965 100644 --- a/libstdc++-v3/testsuite/ext/triangular_distribution/cons/parms.cc +++ b/libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/parms.cc diff --git a/libstdc++-v3/testsuite/ext/triangular_distribution/operators/equal.cc b/libstdc++-v3/testsuite/ext/random/triangular_distribution/operators/equal.cc index c38ea4c..c38ea4c 100644 --- a/libstdc++-v3/testsuite/ext/triangular_distribution/operators/equal.cc +++ b/libstdc++-v3/testsuite/ext/random/triangular_distribution/operators/equal.cc diff --git a/libstdc++-v3/testsuite/ext/triangular_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/ext/random/triangular_distribution/operators/inequal.cc index c4a014e..c4a014e 100644 --- a/libstdc++-v3/testsuite/ext/triangular_distribution/operators/inequal.cc +++ b/libstdc++-v3/testsuite/ext/random/triangular_distribution/operators/inequal.cc diff --git a/libstdc++-v3/testsuite/ext/triangular_distribution/operators/serialize.cc b/libstdc++-v3/testsuite/ext/random/triangular_distribution/operators/serialize.cc index 7878376..7878376 100644 --- a/libstdc++-v3/testsuite/ext/triangular_distribution/operators/serialize.cc +++ b/libstdc++-v3/testsuite/ext/random/triangular_distribution/operators/serialize.cc diff --git a/libstdc++-v3/testsuite/ext/triangular_distribution/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/ext/random/triangular_distribution/requirements/explicit_instantiation/1.cc index 189bdaf..189bdaf 100644 --- a/libstdc++-v3/testsuite/ext/triangular_distribution/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/ext/random/triangular_distribution/requirements/explicit_instantiation/1.cc diff --git a/libstdc++-v3/testsuite/ext/triangular_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/ext/random/triangular_distribution/requirements/typedefs.cc index 835e8e7..835e8e7 100644 --- a/libstdc++-v3/testsuite/ext/triangular_distribution/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/ext/random/triangular_distribution/requirements/typedefs.cc diff --git a/libstdc++-v3/testsuite/ext/von_mises_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/cons/default.cc index 3183c85..3183c85 100644 --- a/libstdc++-v3/testsuite/ext/von_mises_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/cons/default.cc diff --git a/libstdc++-v3/testsuite/ext/von_mises_distribution/cons/parms.cc b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/cons/parms.cc index 6c1f8f7..6c1f8f7 100644 --- a/libstdc++-v3/testsuite/ext/von_mises_distribution/cons/parms.cc +++ b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/cons/parms.cc diff --git a/libstdc++-v3/testsuite/ext/von_mises_distribution/operators/equal.cc b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/operators/equal.cc index 569a9aa..569a9aa 100644 --- a/libstdc++-v3/testsuite/ext/von_mises_distribution/operators/equal.cc +++ b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/operators/equal.cc diff --git a/libstdc++-v3/testsuite/ext/von_mises_distribution/operators/inequal.cc b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/operators/inequal.cc index a4d2d8d..a4d2d8d 100644 --- a/libstdc++-v3/testsuite/ext/von_mises_distribution/operators/inequal.cc +++ b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/operators/inequal.cc diff --git a/libstdc++-v3/testsuite/ext/von_mises_distribution/operators/serialize.cc b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/operators/serialize.cc index 5437c13..5437c13 100644 --- a/libstdc++-v3/testsuite/ext/von_mises_distribution/operators/serialize.cc +++ b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/operators/serialize.cc diff --git a/libstdc++-v3/testsuite/ext/von_mises_distribution/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/requirements/explicit_instantiation/1.cc index d93093f..d93093f 100644 --- a/libstdc++-v3/testsuite/ext/von_mises_distribution/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/requirements/explicit_instantiation/1.cc diff --git a/libstdc++-v3/testsuite/ext/von_mises_distribution/requirements/typedefs.cc b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/requirements/typedefs.cc index c8c34ab..c8c34ab 100644 --- a/libstdc++-v3/testsuite/ext/von_mises_distribution/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/requirements/typedefs.cc |