Boost logo

Boost Users :

Subject: Re: [Boost-users] boost random uniform real infinite loop
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-10-31 13:15:30


AMDG

On 10/29/2011 05:03 PM, Peter Man wrote:
> Recently, I've encountered a problem with the generate_uniform_real
> function (the is_integral version) in
> boost/random/uniform_real_distribution.hpp.
> A bug in my code meant that I was trying to generate a uniform random
> number where the min and max bounds were exactly equal.
> However, this meant that when on entering the function stated earlier,
> an infinite loop is never exited from! Is this a bug in boost::random,
> or have I missed something?
>

uniform_real_distribution is supposed to
produce a value in the range [min, max).
This is impossible if min == max, since
the range is empty.

In Christ,
Steven Watanabe


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