summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-24 13:43:19 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-24 13:43:19 +0000
commit951e6bdf3869cc6d4b3275af0220eab415641dcb (patch)
tree212df7f101c1d4c1d83c8254797ff05535bde0fb /libstdc++-v3
parent0370f12c36079259d344480d8f1fdcd80f7aa783 (diff)
downloadgcc-951e6bdf3869cc6d4b3275af0220eab415641dcb.tar.gz
PR libstdc++/80506 fix constant used in condition
PR libstdc++/80506 * include/bits/random.tcc (gamma_distribution::operator()): Fix magic number used in loop condition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247099 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/include/bits/random.tcc2
2 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index f2d139accf5..f2b533b4ae9 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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.
diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc
index df05ebea6e9..63d1c020285 100644
--- a/libstdc++-v3/include/bits/random.tcc
+++ b/libstdc++-v3/include/bits/random.tcc
@@ -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)))));