From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-12-20 16:27:09


Fernando Cacciola wrote:
> I was using the random number library and I found a particular situation in
> which some constructor enters an endless loop.

Thank you for your bug report.
 
> #include <boost/random/linear_congruential.hpp>
> #include <boost/random/uniform_int.hpp>
>
> int main()
> {
> using namespace boost ;
>
> minstd_rand rnd ;
> uniform_int<minstd_rand> x(rnd,0,8361); // --> This CTOR loops for ever.
>
> return 0 ;
> }
>
> I'm using boost 1.25.0 with Borland C++ 5.5.1 (BCB actually).

I've added your test case to random_test.cpp.

I had fixed a bunch of overflows in uniform_int<> for
Boost version 1.26.0, and indeed, the test case above doesn't
lead to an endless loop with the current CVS version of Boost.Random.
Consider getting only boost/random from the CVS (or 1.26.0),
it should be usable with the rest of boost being 1.25.0.

Jens Maurer