From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25736 invoked by alias); 3 Jun 2009 15:49:56 -0000 Received: (qmail 24784 invoked by uid 48); 3 Jun 2009 15:49:43 -0000 Date: Wed, 03 Jun 2009 15:49:00 -0000 Subject: [Bug libstdc++/40331] New: uniform_real random number distribution produces wildly out of range values (TR1 & C++0x) X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "colin at gibibit dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00133.txt.bz2 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 and uniform_real 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