Boost logo

Boost Users :

Subject: Re: [Boost-users] [random] infinite loop in uniform_real_distribution
From: Jérémy Coulon (jeremy.coulon_at_[hidden])
Date: 2013-11-25 16:27:37


Le 25/11/2013 22:03, Brian Budge a écrit :
> It seems to me that it's not really just "large" that is the issue,
> but only if you have a range larger than
> std::numeric_limits<float>::max(). Ideally, you'd not really want to
> be messing with too very many numbers that are within many orders of
> magnitude of the max float value, as your precision will be awful.
> Are you just edge-case testing, or do you have a real reason to
> generate uniform distributions over this range?
>
> Brian
The documentation doesn't say anything about the input range of the
distribution.
So I expect it to work with *any* range.
As for the real reason, I need to unit-test a function of my own code
that takes a float as an argument.
I want to test that my function behaves correctly for any given float.
Using a few thousands of randomly generated floats and calling my
function with that seems a good idea.

Jeremy


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