[Issue 5240] Faster std.random.uniform() for [0.0, 1.0) range

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 2 23:34:46 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=5240



--- Comment #7 from github-bugzilla at puremagic.com 2014-04-02 23:34:23 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/d0727dc7a02a33d855cc141f09f883501077797b
Fix Issue #5240: faster std.random.uniform for [0.0, 1.0) range

Following typical design in other languages, the function is named
uniform01.  It can be templated on floating-point type, defaulting
to double if none is specified.

The implementation is pretty much derived from its counterpart in
Boost.Random, in particular in its taking account of the different
requirements for integral versus floating-point RNG values, and in
checking that the generated variate is less than 1 before returning.
This last check is necessary simply because we can't guarantee, in
the case of a floating-point based RNG, that we will not get a
result exactly equal to 1.

Fixes http://d.puremagic.com/issues/show_bug.cgi?id=5240

https://github.com/D-Programming-Language/phobos/commit/0ba2004bd4d725c5ccff227a65bc19a6e3371381
Merge pull request #2050 from WebDrake/uniform01

Fix Issue #5240: faster std.random.uniform for [0.0, 1.0) range

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list