]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR libstdc++/80506 fix constant used in condition
authorJonathan Wakely <jwakely@redhat.com>
Mon, 24 Apr 2017 13:43:19 +0000 (14:43 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 24 Apr 2017 13:43:19 +0000 (14:43 +0100)
PR libstdc++/80506
* include/bits/random.tcc (gamma_distribution::operator()): Fix magic
number used in loop condition.

From-SVN: r247099

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

index f2d139accf5cc70b38e091eb70479241436f35bd..f2b533b4ae94ad2cd18dc24620db700431a9b5e0 100644 (file)
@@ -1,5 +1,9 @@
 2017-04-24  Jonathan Wakely  <jwakely@redhat.com>
 
+       PR libstdc++/80506
+       * include/bits/random.tcc (gamma_distribution::operator()): Fix magic
+       number used in loop condition.
+
        PR libstdc++/80504
        * include/bits/refwrap.h (ref, cref): Qualify calls.
        * testsuite/20_util/reference_wrapper/80504.cc: New test.
index df05ebea6e9ab9f8aae25d619df3f079e1b73668..63d1c020285d4ed0ed939619b8b7f340d13f8e3d 100644 (file)
@@ -2356,7 +2356,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            __v = __v * __v * __v;
            __u = __aurng();
          }
-       while (__u > result_type(1.0) - 0.331 * __n * __n * __n * __n
+       while (__u > result_type(1.0) - 0.0331 * __n * __n * __n * __n
               && (std::log(__u) > (0.5 * __n * __n + __a1
                                    * (1.0 - __v + std::log(__v)))));