Boost Users :
Date: 2004-02-13 04:49:21
I have either overlooked something basic or found a bug in the random library:
double result_ = boost::uniform_real<double>(0., 1.) (engine_);
std::cout << result_ << std::endl;
assert ( (0. <= result_) && (result_ < 1.) );
test_boost: test/test_boost.cpp:17: void test_random (): Assertion `(0. <=
result_) && (result_ < 1.)' failed.
Although the documentation says "The current implementation is buggy, because it
may not fill all of the mantissa with random bits." IMHO this is worse than
that: I expected the result to satisfy min <= result < max.
I'm using boost 1.31.0 and g++ 2.96 as well as g++ 3.3.2 (identical results) on
Red Hat Linux.
I hope that either someone can explain me my mistake or fix the bug.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net