mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 18:02:17 +01:00
106 lines
2.6 KiB
XML
106 lines
2.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 7431c7296886d6b8481dfda0284789873e1dbea8 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-random">
|
|
<refnamediv>
|
|
<refname>gmp_random</refname>
|
|
<refpurpose>Nombre GMP aléatoire</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsynopsisdiv>
|
|
&warn.deprecated.function-7-2-0.removed-8-0-0;
|
|
</refsynopsisdiv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>GMP</type><methodname>gmp_random</methodname>
|
|
<methodparam choice="opt"><type>int</type><parameter>limiter</parameter><initializer>20</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Génère un nombre aléatoire. Ce nombre sera compris entre zéro et (2 ** n) -1,
|
|
où n est le nombre de bits par limb multiplié par <parameter>limiter</parameter>.
|
|
Si <parameter>limiter</parameter> est négatif, un nombre négatif est généré.
|
|
</para>
|
|
<para>
|
|
Un limb est un mécanisme interne de GMP. Le nombre de bits dans un limb
|
|
n'est pas statique, et peut varier entre les systèmes. En général, le nombre
|
|
de bits par limb est 32 ou 64, mais ce n'est pas garantit.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>limiter</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le limiteur.
|
|
</para>
|
|
&gmp.parameter;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Un nombre GMP aléatoire.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>gmp_random</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$rand1 = gmp_random(1); // nombre aléatoire de 0 à 1 * bits par limb
|
|
$rand2 = gmp_random(2); // nombre aléatoire de 0 à 2 * bits par limb
|
|
|
|
echo gmp_strval($rand1) . "\n";
|
|
echo gmp_strval($rand2) . "\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
1915834968
|
|
8642564075890328087
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|