diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 077e48386c0b35296c82b785d62b8b2f0a42fee2..2c1ffd21598adf54d63fc3df73b34d6b3dc469cf 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +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> diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h index e1887e2978f0578b99a7f50f81008d1ee4793c6a..b471726be5562ede3105d9d33557addc9748e9e3 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 6220a5d61d4dea8023150f69db8a2c7e51561007..acd458214e41ff9674bcc0a3cf11c0413673d6d5 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; }