[Issue 2921] New: std.random.uniform doesn't work with char.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat May 2 10:25:11 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2921
Summary: std.random.uniform doesn't work with char.
Product: D
Version: 2.029
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: bugzilla at digitalmars.com
ReportedBy: dsimcha at yahoo.com
import std.random, std.stdio;
void main() {
foreach(i; 0..1_000) {
write(uniform!"[]"('A', 'Z'));
}
}
Prints: All A's. If 'A' and 'Z' are cast to ubyte, the results look
reasonable.
--
More information about the Digitalmars-d-bugs
mailing list