Boost logo

Boost :

Subject: [boost] [random] uniform_real problem (what, again?)
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2012-01-10 08:03:23


Testing with 1.47.0, I know we added an assert
min <= max

But is min==max valid? I just tried testing with
a uniform_real (0,0), and it seems to hang forever.

I haven't tried to fully analyze the code, but I'm guessing this could be a
problem:
        if(result < max_value) return result;

So should that assert be min < max?

Also, I find it unfortunate that it is not possible to use uniform_real (x,x) as
a limiting case - it occurs naturally in my code when I don't actually want to
generate a range of values but just a constant value.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk