diff options
author | Paolo Carlini <pcarlini@suse.de> | 2006-08-22 22:57:53 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2006-08-22 22:57:53 +0000 |
commit | 53fdb339085978c4cf051feca17e65d3e7de45e7 (patch) | |
tree | ade2726bfd9742ea1d0e6f215b5e2f8f3327f311 /libstdc++-v3/include/tr1 | |
parent | a25ce4dbf97245d64ec5f32787eebee6beafec76 (diff) | |
download | gcc-53fdb339085978c4cf051feca17e65d3e7de45e7.zip gcc-53fdb339085978c4cf051feca17e65d3e7de45e7.tar.gz gcc-53fdb339085978c4cf051feca17e65d3e7de45e7.tar.bz2 |
random.tcc (subtract_with_carry_01<>:: seed(_Gen&, false_type)): Fix _M_carry initialization.
2006-08-22 Paolo Carlini <pcarlini@suse.de>
* include/tr1/random.tcc (subtract_with_carry_01<>::
seed(_Gen&, false_type)): Fix _M_carry initialization.
* testsuite/tr1/5_numerical_facilities/random/
subtract_with_carry/cons/default.cc: Qualify 1 as 1UL.
* testsuite/tr1/5_numerical_facilities/random/
subtract_with_carry/cons/gen1.cc: Likewise.
From-SVN: r116334
Diffstat (limited to 'libstdc++-v3/include/tr1')
-rw-r--r-- | libstdc++-v3/include/tr1/random.tcc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libstdc++-v3/include/tr1/random.tcc b/libstdc++-v3/include/tr1/random.tcc index 2880aad5..cbeb57d 100644 --- a/libstdc++-v3/include/tr1/random.tcc +++ b/libstdc++-v3/include/tr1/random.tcc @@ -484,7 +484,15 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) _M_x[__i][__n - 1] = __mod<_UInt32Type, 1, 0, _Shift<_UInt32Type, __w % 32>::__value>(__gen()); } - _M_carry = (_M_x[long_lag - 1][0] == 0) ? 1 : 0; + + _M_carry = 1; + for (int __j = 0; __j < __n; ++__j) + if (_M_x[long_lag - 1][__j] != 0) + { + _M_carry = 0; + break; + } + _M_p = 0; // Initialize the array holding the negative powers of 2. |