November 13, 2020 [Issue 21383] New: std.random.uniform!T(urng) when T is dchar disregards urng and always uses a thread-local random | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21383 Issue ID: 21383 Summary: std.random.uniform!T(urng) when T is dchar disregards urng and always uses a thread-local random Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: n8sh.secondary@hotmail.com std.random.uniform!T(urng) when T is dchar disregards urng and always uses a thread-local random Demonstration: --- void main() { // The following loop is unlikely to complete without an assertion failure: foreach (_; 0 .. 100) { import std.random : uniform, Xorshift32; auto rng0 = Xorshift32(123456789); auto rng1 = Xorshift32(123456789); assert(uniform!dchar(rng0) == uniform!dchar(rng1)); } } --- -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply