From b59d6a2bba815b2ffc5eea4de6749f5e24b16743 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sat, 20 Oct 2007 10:02:09 +0000 Subject: [PATCH] random (uniform_int<>::_M_call(_UniformRandomNumberGenerator&, result_type, result_type, true_type)): Fix small thinko. 2007-10-20 Paolo Carlini * include/tr1_impl/random (uniform_int<>::_M_call(_UniformRandomNumberGenerator&, result_type, result_type, true_type)): Fix small thinko. From-SVN: r129506 --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/include/tr1_impl/random | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b4f58acbc09..c839f27efed 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2007-10-20 Paolo Carlini + + * include/tr1_impl/random + (uniform_int<>::_M_call(_UniformRandomNumberGenerator&, result_type, + result_type, true_type)): Fix small thinko. + 2007-10-19 Paolo Carlini PR libstdc++/33815 diff --git a/libstdc++-v3/include/tr1_impl/random b/libstdc++-v3/include/tr1_impl/random index f44b17f9792..7b9b951f74a 100644 --- a/libstdc++-v3/include/tr1_impl/random +++ b/libstdc++-v3/include/tr1_impl/random @@ -1609,7 +1609,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 // is smaller than __max - __min. typedef typename __gnu_cxx::__add_unsigned::__type __utype; - return result_type((__max - __min + 1.0L) * __utype(__urng()) + return result_type((__max - __min + 1.0L) + * (__utype(__urng()) - __utype(__urng.min())) / (__utype(__urng.max()) - __utype(__urng.min()) + 1.0L)) + __min; } -- 2.30.2