This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/33128] New: std::tr1::uniform_int returns value out of range
- From: "mj1 at cog dot brown dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Aug 2007 23:22:37 -0000
- Subject: [Bug libstdc++/33128] New: std::tr1::uniform_int returns value out of range
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The uniform_int distribution in the following program (copied from start of the
Boost random documentation) returns a value (-1) that is outside of its range.
Thanks,
Mark Johnson
#include <iostream>
#include <tr1/random>
int main() {
std::tr1::mt19937 rng;
std::tr1::uniform_int<> six(1,6);
std::tr1::variate_generator<std::tr1::mt19937, std::tr1::uniform_int<> >
die(rng, six);
std::cout << "die() = " << die() << std::endl;
}
// [mj@lugha tmp]$ a.out
// die() = -1
--
Summary: std::tr1::uniform_int returns value out of range
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mj1 at cog dot brown dot edu
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33128