mirror of
https://github.com/php/doc-it.git
synced 2026-04-29 10:13:13 +02:00
1c37529476
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@78500 c90b9560-bf6c-de11-be94-00142212c4b1
63 lines
1.8 KiB
XML
63 lines
1.8 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- splitted from ./it/functions/math.xml, last change in rev 1.1 -->
|
|
<!-- last change to 'srand' in en/ tree in rev 1.2 -->
|
|
<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready -->
|
|
<!-- OLD-Revision: 1.78/EN.1.2 -->
|
|
<refentry id="function.srand">
|
|
<refnamediv>
|
|
<refname>srand</refname>
|
|
<refpurpose>inizializza il generatore di numeri casuali</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descrizione</title>
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>srand</methodname>
|
|
<methodparam><type>int</type><parameter>seme</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Inizializza il generatore di num casuali con
|
|
<parameter>seme</parameter>.
|
|
<informalexample>
|
|
<programlisting>
|
|
<![CDATA[
|
|
// inizializza usando i microsecondi
|
|
function crea_seme() {
|
|
list($usec, $sec) = explode(' ', microtime());
|
|
return (float) $sec + ((float) $usec * 100000);
|
|
}
|
|
srand((double)microtime()*1000000);
|
|
$valorecasuale = rand();
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<simpara>
|
|
Vedere anche <function>rand</function>,
|
|
<function>getrandmax</function>, <function>mt_rand</function>,
|
|
<function>mt_srand</function> e
|
|
<function>mt_getrandmax</function>.
|
|
</simpara>
|
|
</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:"../../../../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
|
|
-->
|