Commit 957221f5 by Jonathan Wakely Committed by Jonathan Wakely

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.

From-SVN: r247099
parent 3ebd8e62
2017-04-24 Jonathan Wakely <jwakely@redhat.com> 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 PR libstdc++/80504
* include/bits/refwrap.h (ref, cref): Qualify calls. * include/bits/refwrap.h (ref, cref): Qualify calls.
* testsuite/20_util/reference_wrapper/80504.cc: New test. * testsuite/20_util/reference_wrapper/80504.cc: New test.
......
...@@ -2356,7 +2356,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -2356,7 +2356,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__v = __v * __v * __v; __v = __v * __v * __v;
__u = __aurng(); __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 && (std::log(__u) > (0.5 * __n * __n + __a1
* (1.0 - __v + std::log(__v))))); * (1.0 - __v + std::log(__v)))));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment