diff options
Diffstat (limited to 'libphobos/src/std/random.d')
-rw-r--r-- | libphobos/src/std/random.d | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libphobos/src/std/random.d b/libphobos/src/std/random.d index b3116e18..f4c64d4 100644 --- a/libphobos/src/std/random.d +++ b/libphobos/src/std/random.d @@ -64,15 +64,15 @@ import std.traits; // Generate a uniformly-distributed integer in the range [0, 14] // If no random generator is passed, the global `rndGen` would be used auto i = uniform(0, 15, rnd); - assert(i == 12); + assert(i >= 0 && i < 15); // Generate a uniformly-distributed real in the range [0, 100) auto r = uniform(0.0L, 100.0L, rnd); - assert(r == 79.65429843861011285); + assert(r >= 0 && r < 100); // Generate a 32-bit random number auto u = uniform!uint(rnd); - assert(u == 4083286876); + static assert(is(typeof(u) == uint)); } version (unittest) |