4.28 Misc arithmetic support predicates
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Misc arithmetic support predicates
          • set_random/1
          • random_property/1
          • current_arithmetic_function/1
    • Packages
Availability:built-in
set_random(+Option)
Controls the random number generator accessible through the functions random/1 and random_float/0. Note that the library library(random) provides an alternative API to the same random primitives.
seed(+Seed)
Set the seed of the random generator for this thread. Seed is an integer or the atom random. If random, repeat the initialization procedure described with the function random/1. Here is an example:
?- set_random(seed(111)), A is random(6).
A = 5.
?- set_random(seed(111)), A is random(6).
A = 5.
state(+State)
Set the generator to a state fetched using the state property of random_property/1. Using other values may lead to undefined behaviour.133The limitations of the underlying (GMP) library are unknown, which makes it impossible to validate the State.