YAP 7.1.0
Random Number Generator

Since YAP-4.3.19 YAP uses the O'Keefe public-domain algorithm, based on the "Applied Statistics" algorithm AS183. More...

Detailed Description

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 Documentation

◆ getrand/1

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

◆ random/3

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