Sampling bug in uniform_real (random)

Paolo Carlini
Mon Jan 19 14:39:00 GMT 2009

> Hello,
> There is a bug in the generation code of the class uniform_real
> (uniform_real::operator()(somerng) ).  The range of the random number
> generator used is not used so generated samples are not in the expected
> range at all.
I'm not sure this is a bug. In fact we have:

   * probability throughout the range.  The URNG should be real-valued and
   * deliver number in the range [0, 1).

And I think this comment is consistent with 5.1.1/9 of N1836.


More information about the Libstdc++ mailing list