![]() |
YAP 7.1.0
|
Since YAP-4.3.19 YAP uses the O'Keefe public-domain algorithm, based on the "Applied Statistics" algorithm AS183. More...
Since YAP-4.3.19 YAP uses the O'Keefe public-domain algorithm, based on the "Applied Statistics" algorithm AS183.
The following random number operations are included with the use_module(library(random))
command
In ROK's words: ``This is algorithm AS 183 from Applied Statistics I also have a C version It is really very good It is straightforward to make a version which yields 15-bit random integers using only integer arithmetic''
Modules | |
Pseudo Random Number Integer Generator | |
The following routines produce random non-negative integers in the range 0. | |
class getrand/1 |
getrand(- Key)
Unify Key with a term of the form rand(X,Y,Z)
describing the current state of the random number generator
class random/3 |
random(+ LOW, + HIGH, - NUMBER)
Unify Number with a number in the range [LOW...HIGH)
If both LOW and HIGH are integers then NUMBER will also be an integer, otherwise NUMBER will be a floating-point number