Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions reference/random/book.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 550b9c3c31a66c18c9303794c12260bf5c684fed Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: no -->
<book xml:id="book.random" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<?phpdoc extension-membership="core" ?>
<title>Generadores de números aleatorios y funciones relacionadas con la aleatoriedad.</title>
<titleabbrev>Random</titleabbrev>

<preface xml:id="intro.random">
&reftitle.intro;
<para>

</para>
</preface>

&reference.random.constants;
&reference.random.examples;
&reference.random.reference;

&reference.random.random.randomizer;
&reference.random.random.intervalboundary;

&reference.random.random.engine;
&reference.random.random.cryptosafeengine;

&reference.random.random.engine.secure;
&reference.random.random.engine.mt19937;
&reference.random.random.engine.pcgoneseq128xslrr64;
&reference.random.random.engine.xoshiro256starstar;

&reference.random.random.randomerror;
&reference.random.random.brokenrandomengineerror;
&reference.random.random.randomexception;

</book>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
64 changes: 64 additions & 0 deletions reference/random/constants.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: c4f24e2eef1a3c970c491c0ee8cbc1f290ff023a Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: no -->
<appendix xml:id="random.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.constants;
&extension.constants.core;
<para>
<variablelist>
<varlistentry xml:id="constant.mt-rand-mt19937">
<term>
<constant>MT_RAND_MT19937</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Indica que la implementación correcta de <link xlink:href="&url.random.mersenne-twister;">Mt19937</link> (Mersenne Twister)
será utilizada por el algoritmo al crear una instancia de <classname>Random\Engine\Mt19937</classname>
utilizando <function>Random\Engine\Mt19937::__construct</function> o al inicializar el Mersenne Twister global
con <function>mt_srand</function>.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.mt-rand-php">
<term>
<constant>MT_RAND_PHP</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Indica que una implementación incorrecta de Mersenne Twister será utilizada por el algoritmo, al
crear una instancia de <classname>Random\Engine\Mt19937</classname> utilizando
<function>Random\Engine\Mt19937::__construct</function> o al inicializar el Mersenne Twister global
con <function>mt_srand</function>.
</simpara>
<simpara>
La implementación incorrecta está disponible para garantizar la compatibilidad ascendente con
<function>mt_srand</function> anterior a PHP 7.1.0.
</simpara>
&warn.deprecated.feature-8-3-0;
</listitem>
</varlistentry>
</variablelist>
</para>
</appendix>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
44 changes: 44 additions & 0 deletions reference/random/examples.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 2166824858a40ea664c558f2930b63b8f4fd89c6 Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: no -->
<chapter xml:id="random.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<example>
<title>Ejemplo Random</title>
<programlisting role="php">
<![CDATA[
<?php

/* ... */

?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
...
]]>
</screen>
</example>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
65 changes: 65 additions & 0 deletions reference/random/functions/getrandmax.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 2166824858a40ea664c558f2930b63b8f4fd89c6 Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: no -->

<refentry xml:id="function.getrandmax" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>getrandmax</refname>
<refpurpose>Valor aleatorio máximo posible</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>getrandmax</methodname>
<void/>
</methodsynopsis>
<simpara>
Devuelve el valor aleatorio máximo posible
retornado por <function>rand</function>.
</simpara>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
El valor aleatorio máximo posible retornado por <function>rand</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>rand</function></member>
<member><function>srand</function></member>
<member><function>mt_getrandmax</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
114 changes: 114 additions & 0 deletions reference/random/functions/lcg-value.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 9b1673cf114a1e10c4563ab9223cb56aed552b89 Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: no -->

<refentry xml:id="function.lcg-value" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>lcg_value</refname>
<refpurpose>Generador de congruencia lineal combinada</refpurpose>
</refnamediv>

<refsynopsisdiv>
&warn.deprecated.function-8-4-0;
</refsynopsisdiv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier role="attribute">#[\Deprecated]</modifier>
<type>float</type><methodname>lcg_value</methodname>
<void/>
</methodsynopsis>
<para>
<function>lcg_value</function> devuelve un número pseudoaleatorio,
comprendido entre 0 y 1. <function>lcg_value</function> combina dos
generadores de congruencia, con períodos respectivos de
<literal>2^31 - 85</literal> y <literal>2^31 - 249</literal>.
El período de esta función es el producto de estos dos
números primos (es decir, <literal>(2^31 - 85)*(2^31 - 249)</literal>).
</para>
&caution.cryptographically-insecure;
<caution>
<para>
Escalar el valor de retorno a un intervalo diferente utilizando la multiplicación
o la adición (una transformación afín) puede provocar un sesgo
en el valor resultante, ya que los números de punto flotante no están distribuidos uniformemente
en la línea numérica.
Como no todos los valores pueden ser representados exactamente por un número de punto flotante, el
resultado de la transformación afín también puede dar valores fuera
del intervalo solicitado.
</para>
<para>
Utilice <methodname>Random\Randomizer::getFloat</methodname> para generar un
número de punto flotante aleatorio en un intervalo arbitrario. Utilice <methodname>Random\Randomizer::getInt</methodname>
para generar un entero aleatorio en un intervalo arbitrario.
</para>
</caution>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Un valor pseudoaleatorio, en el intervalo de 0.0 a 1.0 inclusive.
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
Esta función ha sido deprecada.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>Random\Randomizer::getFloat</methodname></member>
<member><methodname>Random\Randomizer::getInt</methodname></member>
<member><function>random_int</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
Loading