]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/48114 ([C++0x] binomial_distribution incorrect for p > .5 and geometr...
authorAndrey Zholos <aaz@althenia.net>
Mon, 14 Mar 2011 18:10:36 +0000 (18:10 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 14 Mar 2011 18:10:36 +0000 (18:10 +0000)
2011-03-14  Andrey Zholos  <aaz@althenia.net>

PR libstdc++/48114
* include/bits/random.tcc (binomial_distribution<>::operator()):
Fix thinko in computation, __param.p() is a double.

From-SVN: r170950

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/random.tcc

index 6664a00b88ad722d6197ab83182b0c025e259ed5..e658556debaa623b63213cfdde94a98a99c00e0a 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-14  Andrey Zholos  <aaz@althenia.net>
+
+       PR libstdc++/48114
+       * include/bits/random.tcc (binomial_distribution<>::operator()):
+       Fix thinko in computation, __param.p() is a double.
+
 2011-02-25  Johannes Singler  <singler@kit.edu>
 
         PR libstdc++/47433
index 7efd6f8e4014f2ed1d189dcfa29d1130f26e4238..d3e2ac76c2d91d368a1ab7275d59c9120c93c069 100644 (file)
@@ -1,6 +1,6 @@
 // random number generation (out of line) -*- C++ -*-
 
-// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -1392,7 +1392,7 @@ namespace std
       {
        result_type __ret;
        const _IntType __t = __param.t();
-       const _IntType __p = __param.p();
+       const double __p = __param.p();
        const double __p12 = __p <= 0.5 ? __p : 1.0 - __p;
        __detail::_Adaptor<_UniformRandomNumberGenerator, double>
          __aurng(__urng);