Author(s): Daniel Cabeza.
Version: 1.11#222 (2004/5/24, 13:8:7 CEST)
Version of last change: 1.9#275 (2004/1/9, 16:25:9 CET)
This module provides predicates for generating pseudo-random numbers
random
)random
)
random(Number)
Number
is a (pseudo-) random number in the range [0.0,1.0]
Usage:
Number
is a free variable.
(term_typing:var/1
)
Number
is currently instantiated to a float.
(term_typing:float/1
)
random(Low, Up, Number)
Number
is a (pseudo-) random number in the range [Low
, Up
]
Usage 1:
Low
and Up
are integers, Number
is an integer.
Low
is an integer.
(basic_props:int/1
)
Up
is an integer.
(basic_props:int/1
)
Number
is a free variable.
(term_typing:var/1
)
Number
is an integer.
(basic_props:int/1
)
Usage 2:
Low
is a float.
(basic_props:flt/1
)
Up
is a number.
(basic_props:num/1
)
Number
is a free variable.
(term_typing:var/1
)
Number
is a float.
(basic_props:flt/1
)
Usage 3:
Low
is an integer.
(basic_props:int/1
)
Up
is a float.
(basic_props:flt/1
)
Number
is a free variable.
(term_typing:var/1
)
Number
is a float.
(basic_props:flt/1
)
srandom(Seed)
Changes the sequence of pseudo-random numbers according to Seed
. The stating sequence of numbers generated can be duplicated by calling the predicate with Seed
unbound (the sequence depends on the OS).
Usage:
Seed
is an integer.
(basic_props:int/1
)
Seed
is an integer.
(basic_props:int/1
)
Go to the first, previous, next, last section, table of contents.