From 4c9004671af455a03acb4e2750b12d62b2b3c917 Mon Sep 17 00:00:00 2001 From: Ferenc Arn Date: Sat, 14 Jan 2017 23:34:51 -0600 Subject: Replace the existing PRNG (Xorshift31) with (minimal) PCG (XSH-RR variant with 32-bit output, 64-bit state). PCG is better than many alternatives by many metrics (see www.pcg-random.org) including statistical quality with good speed. --- doc/base/classes.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 0088f576f0..0b8c5cc11c 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -463,7 +463,7 @@ - Random range, any floating point value between 'from' and 'to' + Random range, any floating point value between 'from' and 'to'. @@ -472,28 +472,28 @@ - Random from seed, pass a seed and an array with both number and new seed is returned. + Random from seed: pass a seed, and an array with both number and new seed is returned. "Seed" here refers to the internal state of the pseudo random number generator. The internal state of the current implementation is 64 bits. - Random value (0 to 1 float). + Return a random floating point value between 0 and 1. - Random 32 bits value (integer). To obtain a value from 0 to N, you can use remainder, like (for random from 0 to 19): randi() % 20. + Return a random 32 bits integer value. To obtain a random value between 0 to N (where N is smaller than 2^32 - 1), you can use remainder. For example, to get a random integer between 0 and 19 inclusive, you can use randi() % 20. - Reset the seed of the random number generator with a new, different one. + Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. -- cgit v1.2.3