Thread overview
[Issue 15147] std.random.uniform return value depends on integer size
Mar 31, 2018
Seb
Oct 09, 2018
Jon Degenhardt
Oct 10, 2018
Jon Degenhardt
Dec 17, 2022
Iain Buclaw
March 31, 2018
https://issues.dlang.org/show_bug.cgi?id=15147

Seb <greensunny12@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12@gmail.com

--- Comment #1 from Seb <greensunny12@gmail.com> ---
I just ran into this when trying to add more/better public examples for std.random (https://github.com/dlang/phobos/pull/6393).

Normally, examples can be done by seeding the RNG and thus _knowing_ the
sequence of the PRNG.
The current behavior is really nasty.

--
October 09, 2018
https://issues.dlang.org/show_bug.cgi?id=15147

Jon Degenhardt <jrdemail2000-dlang@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jrdemail2000-dlang@yahoo.co
                   |                            |m

--
October 10, 2018
https://issues.dlang.org/show_bug.cgi?id=15147

--- Comment #2 from Jon Degenhardt <jrdemail2000-dlang@yahoo.com> ---
I'm interested in this, as I use these properties extensively for unit tests in randomization routines. Is it also a capability intended to be supported by some of my tools.

The formulation of the unit tests added as part of https://github.com/dlang/phobos/pull/6393 raised a couple questions for me. Those unit tests are qualified as follows:

version(X86_64) // Issue 15147
assert([0, 1, 2, 4, 5].randomShuffle(rnd2).equal([2, 0, 4, 5, 1]));

My questions:
* Is the lack of consistency strictly related to integer size (e.g. 32-bit vs
64-bit), or can these differences surface between different platforms even with
the same integer size?
* For routines like std.random.randomShuffle and std.random.randomCover, is the
issue that these are passing the range length, normally size_t, to
std.random.uniform et.al. The issue being that the size of size_t is platform
specific?

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=15147

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 01
https://issues.dlang.org/show_bug.cgi?id=15147

--- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10144

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--