This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3] Fix thinko in recent changes to linear_congruential_engine<>::seed
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 06 Apr 2009 16:51:57 +0200
- Subject: [v3] Fix thinko in recent changes to linear_congruential_engine<>::seed
HI,
tested x86_64-linux, committed to mainline.
Paolo.
//////////////////
2009-04-06 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/random.tcc (linear_congruential_engine<>::
seed(seed_seq&)): Fix typo in last fix for __m == 0.
Index: include/bits/random.tcc
===================================================================
--- include/bits/random.tcc (revision 145601)
+++ include/bits/random.tcc (working copy)
@@ -119,8 +119,8 @@
seed(seed_seq& __q)
{
const _UIntType __k0 = __m == 0 ? std::numeric_limits<_UIntType>::digits
- : (std::__lg(__m) + 31);
- const _UIntType __k = __k0 / 32;
+ : std::__lg(__m);
+ const _UIntType __k = (__k0 + 31) / 32;
_UIntType __arr[__k + 3];
__q.generate(__arr + 0, __arr + 3);
_UIntType __factor = 1U;