diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2013-02-04 19:28:40 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-02-04 19:28:40 +0000 |
commit | 9ea146e6da49a7fbd1fbace15c79aa372ebae3de (patch) | |
tree | 8fc1e6dcb2a51d8c3f99b9cad3c33a373cd06c4f | |
parent | 5d5bf77569cea0d401a74a3411e4a9c32b28b3ac (diff) | |
download | gcc-9ea146e6da49a7fbd1fbace15c79aa372ebae3de.zip gcc-9ea146e6da49a7fbd1fbace15c79aa372ebae3de.tar.gz gcc-9ea146e6da49a7fbd1fbace15c79aa372ebae3de.tar.bz2 |
PR libstdc++/56202 (again)
2013-02-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/56202 (again)
* include/bits/random.tcc (binomial_distribution<>::
_M_waiting(_UniformRandomNumberGenerator&, _IntType)): Fix thinko
in previous commit.
* include/bits/random.h: Fix comment typo.
Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r195732
-rw-r--r-- | libstdc++-v3/ChangeLog | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/random.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/random.tcc | 8 |
3 files changed, 13 insertions, 7 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 077e483..2c1ffd2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,6 +1,16 @@ 2013-02-04 Manuel López-Ibáñez <manu@gcc.gnu.org> Paolo Carlini <paolo.carlini@oracle.com> + PR libstdc++/56202 (again) + * include/bits/random.tcc (binomial_distribution<>:: + _M_waiting(_UniformRandomNumberGenerator&, _IntType)): Fix thinko + in previous commit. + + * include/bits/random.h: Fix comment typo. + +2013-02-04 Manuel López-Ibáñez <manu@gcc.gnu.org> + Paolo Carlini <paolo.carlini@oracle.com> + PR libstdc++/56202 * include/bits/random.tcc (binomial_distribution<>:: _M_waiting(_UniformRandomNumberGenerator&, _IntType)): Avoid diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h index e1887e2..b471726 100644 --- a/libstdc++-v3/include/bits/random.h +++ b/libstdc++-v3/include/bits/random.h @@ -3770,7 +3770,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @brief A discrete binomial random number distribution. * * The formula for the binomial probability density function is - * @f$p(i|t,p) = \binom{n}{i} p^i (1 - p)^{t - i}@f$ where @f$t@f$ + * @f$p(i|t,p) = \binom{t}{i} p^i (1 - p)^{t - i}@f$ where @f$t@f$ * and @f$p@f$ are the parameters of the distribution. */ template<typename _IntType = int> diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc index 6220a5d..acd4582 100644 --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -1657,13 +1657,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION do { - const double __e = -std::log(1.0 - __aurng()); if (__t == __x) - { - if (__e) - return __x; - continue; - } + return __x; + const double __e = -std::log(1.0 - __aurng()); __sum += __e / (__t - __x); __x += 1; } |