Using either the std::tr1 or C++0x std:: random number generators, the
uniform_real distribution produces numbers that are completely wrong.

For instance, using Boost.Random the test program produces this sequence of
floating point numbers:

Random real: 0.0975404
Random real: 0.547221
Random real: 0.278498
...

On the other hand, both the TR1 and C++0x random number generators produce
something like

Random real: 4.18933e+08
Random real: 2.35029e+09
Random real: 1.19614e+09
...

instead.

This is using the mt19937 random number generator engine and the uniform_real
distribution.  I have tried both uniform_real<float> and uniform_real<double>
and they both have this bug.


-- 
           Summary: uniform_real random number distribution produces wildly
                    out of range values (TR1 & C++0x)
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: colin at gibibit dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40331

Reply via email to