.. index:: single: backend_random
.. _backend_random/0:

.. rst-class:: right

**object**

``backend_random``
==================

Random number generator predicates using the backend Prolog compiler built-in random generator.

| **Availability:** 
|    ``logtalk_load(random(loader))``

| **Author:** Paulo Moura
| **Version:** 1:22:0
| **Date:** 2026-02-11

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Implements:**
|    ``public`` :ref:`pseudo_random_protocol <pseudo_random_protocol/0>`
|    ``public`` :ref:`sampling_protocol <sampling_protocol/0>`
| **Uses:**
|    :ref:`list <list/0>`

| **Remarks:**

   - Implementation: The backend Prolog compiler built-in random generator is only used for the basic ``random/1``, ``get_seed/1``, and ``set_seed/1`` predicates.
   - Portability: B-Prolog, CxProlog, ECLiPSe, JIProlog, Qu-Prolog, and Quintus Prolog do not provide implementations for the ``get_seed/1`` and ``set_seed/1`` predicates and calling these predicates simply succeed without performing any action.

| **Inherited public predicates:**
|     :ref:`sampling_protocol/0::bernoulli/2`  :ref:`sampling_protocol/0::beta/3`  :ref:`random_protocol/0::between/3`  :ref:`sampling_protocol/0::binomial/3`  :ref:`sampling_protocol/0::chi_squared/2`  :ref:`sampling_protocol/0::circular_uniform_cartesian/3`  :ref:`sampling_protocol/0::circular_uniform_polar/3`  :ref:`sampling_protocol/0::dirichlet/2`  :ref:`random_protocol/0::enumerate/2`  :ref:`sampling_protocol/0::exponential/2`  :ref:`sampling_protocol/0::fisher/3`  :ref:`sampling_protocol/0::gamma/3`  :ref:`sampling_protocol/0::geometric/2`  :ref:`pseudo_random_protocol/0::get_seed/1`  :ref:`sampling_protocol/0::gumbel/3`  :ref:`sampling_protocol/0::hypergeometric/4`  :ref:`sampling_protocol/0::logistic/3`  :ref:`sampling_protocol/0::lognormal/3`  :ref:`sampling_protocol/0::logseries/2`  :ref:`random_protocol/0::maybe/0`  :ref:`random_protocol/0::maybe/1`  :ref:`random_protocol/0::maybe/2`  :ref:`random_protocol/0::maybe_call/1`  :ref:`random_protocol/0::maybe_call/2`  :ref:`random_protocol/0::member/2`  :ref:`sampling_protocol/0::normal/3`  :ref:`random_protocol/0::permutation/2`  :ref:`sampling_protocol/0::poisson/2`  :ref:`sampling_protocol/0::power/2`  :ref:`random_protocol/0::random/1`  :ref:`random_protocol/0::random/3`  :ref:`random_protocol/0::randseq/4`  :ref:`random_protocol/0::randset/4`  :ref:`random_protocol/0::select/3`  :ref:`random_protocol/0::select/4`  :ref:`random_protocol/0::sequence/4`  :ref:`random_protocol/0::set/4`  :ref:`pseudo_random_protocol/0::set_seed/1`  :ref:`sampling_protocol/0::standard_cauchy/3`  :ref:`sampling_protocol/0::standard_exponential/1`  :ref:`sampling_protocol/0::standard_gamma/2`  :ref:`sampling_protocol/0::standard_normal/1`  :ref:`sampling_protocol/0::standard_t/2`  :ref:`random_protocol/0::swap/2`  :ref:`random_protocol/0::swap_consecutive/2`  :ref:`sampling_protocol/0::triangular/4`  :ref:`sampling_protocol/0::uniform/1`  :ref:`sampling_protocol/0::uniform/3`  :ref:`sampling_protocol/0::von_mises/3`  :ref:`sampling_protocol/0::wald/3`  :ref:`sampling_protocol/0::weibull/3`  

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

(no local declarations; see entity ancestors if any)

Protected predicates
--------------------

(no local declarations; see entity ancestors if any)

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

.. seealso::

   :ref:`random <random/0>`, :ref:`fast_random <fast_random/0>`

