id summary reporter owner description type status milestone component version severity resolution keywords cc 6059 uniform_real_distribution fails when _min = _max dario.izzo@… Steven Watanabe "Connected to BUG report #6053. Even though all asserts require only that _min <= _max, the condition _min=_max seems to be not handled correctly. Consider the code {{{ #include #include #include int main() { boost::lagged_fibonacci607 rng(32); double r = boost::random::uniform_real_distribution(90,91)(rng); std::cout << r << std::endl; r = boost::random::uniform_real_distribution(50,50)(rng); std::cout << r << std::endl; return 0; } }}} the second std::cout will never execute as an infinite loop is encountered before. The problem is in boost/random/uniform_real_distribution.hpp and in particular at generate_uniform_real line: {{{ if(result < max_value) return result; }}} If min_value == max_value the condition above is never met as result = min_value = max_value ALWAYS. A solution (the one I am currently using) could be {{{ if ( (result < max_value) || (max_value==min_value) ) return result; }}} " Bugs closed To Be Determined random Boost 1.47.0 Problem fixed