cvs: phpdoc-it /reference/math reference.xml /reference/math/functions abs.xml atan2.xml bindec.xml cos.xml decbin.xml dechex.xml decoct.xml
deg2rad.xml exp.xml expm1.xml hexdec.xml hypot.xml is-finite.xml is-infinite.xml is-nan.xml log1p.xml mt-rand.xml mt-srand.xml octdec.xml pow.xml
rad2deg.xml rand.xml round.xml sin.xml sqrt.xml srand.xml tan.xml
| From: | Andrioli Darvin | Date: | Fri, 16 Jan 2004 20:54:32 +0000 |
| Subject: | cvs: phpdoc-it /reference/math reference.xml /reference/math/functions abs.xml atan2.xml bindec.xml cos.xml decbin.xml dechex.xml decoct.xml deg2rad.xml exp.xml expm1.xml hexdec.xml hypot.xml is-finite.xml is-infinite.xml is-nan.xml log1p.xml mt-rand.xml mt-srand.xml octdec.xml pow.xml rad2deg.xml rand.xml round.xml sin.xml sqrt.xml srand.xml tan.xml |
||
| Groups: | php.doc.it | ||
| Request: | Send a blank email to doc-it+get-511@lists.php.net to get a copy of this message | ||
darvina Fri Jan 16 15:54:32 2004 EDT
Modified files:
/phpdoc-it/reference/math reference.xml
/phpdoc-it/reference/math/functions abs.xml atan2.xml bindec.xml
cos.xml decbin.xml dechex.xml
decoct.xml deg2rad.xml exp.xml
expm1.xml hexdec.xml hypot.xml
is-finite.xml is-infinite.xml
is-nan.xml log1p.xml
mt-rand.xml mt-srand.xml
octdec.xml pow.xml rad2deg.xml
rand.xml round.xml sin.xml
sqrt.xml srand.xml tan.xml
Log:
Sync to En tree
Index: phpdoc-it/reference/math/reference.xml diff -u phpdoc-it/reference/math/reference.xml:1.4 phpdoc-it/reference/math/reference.xml:1.5 --- phpdoc-it/reference/math/reference.xml:1.4 Tue Jun 4 09:24:26 2002 +++ phpdoc-it/reference/math/reference.xml Fri Jan 16 15:54:31 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <reference id="ref.math"> <title>Funzioni Matematiche</title> <titleabbrev>Mat</titleabbrev> @@ -14,119 +14,36 @@ Se si ha necessità di lavorare con numeri più grandi, fare riferimento alle <link linkend="ref.bc">funzioni matematiche a precisione arbitraria</link>. </para> - <section id="math.constants"> - &reftitle.constants; - <para> - I seguenti valori sono definiti come costanti nel PHP dall'estensione - matematica del linguaggio: - <table> - <title>Costanti Matematiche</title> - <tgroup cols="3"> - <thead> - <row> - <entry>Costante</entry> - <entry>Valore</entry> - <entry>Descrizione</entry> - </row> - </thead> - <tbody> - <row> - <entry>M_PI</entry> - <entry>3.14159265358979323846</entry> - <entry>Pi</entry> - </row> - <row> - <entry>M_E</entry> - <entry>2.7182818284590452354</entry> - <entry>e</entry> - </row> - <row> - <entry>M_LOG2E</entry> - <entry>1.4426950408889634074</entry> - <entry>log_2 e</entry> - </row> - <row> - <entry>M_LOG10E</entry> - <entry>0.43429448190325182765</entry> - <entry>log_10 e</entry> - </row> - <row> - <entry>M_LN2</entry> - <entry>0.69314718055994530942</entry> - <entry>log_e 2</entry> - </row> - <row> - <entry>M_LN10</entry> - <entry>2.30258509299404568402</entry> - <entry>log_e 10</entry> - </row> - <row> - <entry>M_PI_2</entry> - <entry>1.57079632679489661923</entry> - <entry>pi/2</entry> - </row> - <row> - <entry>M_PI_4</entry> - <entry>0.78539816339744830962</entry> - <entry>pi/4</entry> - </row> - <row> - <entry>M_1_PI</entry> - <entry>0.31830988618379067154</entry> - <entry>1/pi</entry> - </row> - <row> - <entry>M_2_PI</entry> - <entry>0.63661977236758134308</entry> - <entry>2/pi</entry> - </row> - <row> - <entry>M_SQRTPI</entry> - <entry>1.77245385090551602729</entry> - <entry>sqrt(pi) [4.0.2]</entry> - </row> - <row> - <entry>M_2_SQRTPI</entry> - <entry>1.12837916709551257390</entry> - <entry>2/sqrt(pi)</entry> - </row> - <row> - <entry>M_SQRT2</entry> - <entry>1.41421356237309504880</entry> - <entry>sqrt(2)</entry> - </row> - <row> - <entry>M_SQRT3</entry> - <entry>1.73205080756887729352</entry> - <entry>sqrt(3) [4.0.2]</entry> - </row> - <row> - <entry>M_SQRT1_2</entry> - <entry>0.70710678118654752440</entry> - <entry>1/sqrt(2)</entry> - </row> - <row> - <entry>M_LNPI</entry> - <entry>1.14472988584940017414</entry> - <entry>log_e(pi) [4.0.2]</entry> - </row> - <row> - <entry>M_EULER</entry> - <entry>0.57721566490153286061</entry> - <entry>Costante di Eulero [4.0.2]</entry> - </row> - </tbody> - </tgroup> - </table> - Soltanto M_PI è disponibile nelle versioni precedenti alla PHP 4.0.0 (compresa). - Tutte le rimanenti costanti sono disponibili a partire dal PHP 4.0.0. Le costanti - indicate con [4.0.2] sono state aggiunte nel PHP 4.0.2. - </para> - </section> + <simpara> + Vedere anche il manuale alle pagine <link linkend="language.operators.arithmetic">operatori + aritmetici</link>. + </simpara> </section> + + <section id="math.requirements"> + &reftitle.required; + &no.requirement; + </section> + + <section id="math.installation"> + &reftitle.install; + &no.install; + </section> + + <section id="math.configuration"> + &reftitle.runtime; + &no.config; + </section> + + <section id="math.resources"> + &reftitle.resources; + &no.resource; + </section> + + &reference.math.constants; </partintro> -&reference.math.functions; + &reference.math.functions; </reference> <!-- Keep this comment at the end of the file Index: phpdoc-it/reference/math/functions/abs.xml diff -u phpdoc-it/reference/math/functions/abs.xml:1.3 phpdoc-it/reference/math/functions/abs.xml:1.4 --- phpdoc-it/reference/math/functions/abs.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/abs.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> <refentry id="function.abs"> <refnamediv> <refname>abs</refname> @@ -8,7 +8,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>mixed</type><methodname>abs</methodname> + <type>number</type><methodname>abs</methodname> <methodparam><type>mixed</type><parameter>numero</parameter></methodparam> </methodsynopsis> <para> Index: phpdoc-it/reference/math/functions/atan2.xml diff -u phpdoc-it/reference/math/functions/atan2.xml:1.2 phpdoc-it/reference/math/functions/atan2.xml:1.3 --- phpdoc-it/reference/math/functions/atan2.xml:1.2 Wed Apr 17 03:07:16 2002 +++ phpdoc-it/reference/math/functions/atan2.xml Fri Jan 16 15:54:32 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'atan2' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.atan2"> <refnamediv> <refname>atan2</refname> - <refpurpose>arco tangente di due variabili</refpurpose> + <refpurpose>Arco tangente di due variabili</refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> Index: phpdoc-it/reference/math/functions/bindec.xml diff -u phpdoc-it/reference/math/functions/bindec.xml:1.3 phpdoc-it/reference/math/functions/bindec.xml:1.4 --- phpdoc-it/reference/math/functions/bindec.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/bindec.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> <refentry id="function.bindec"> <refnamediv> <refname>bindec</refname> @@ -21,8 +21,35 @@ essere convertito è 31 volte la cifra 1 oppure 2147483647 espresso in formato decimale. </para> <para> - Vedere anche - <function>decbin</function>. + <example> + <title>Esempio di <function>bindec</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo bindec('110011') . "\n"; +echo bindec('000110011') . "\n"; + +echo bindec('111'); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +51 +51 +7 +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>decbin</function>, + <function>octdec</function>, + <function>hexdec</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/cos.xml diff -u phpdoc-it/reference/math/functions/cos.xml:1.3 phpdoc-it/reference/math/functions/cos.xml:1.4 --- phpdoc-it/reference/math/functions/cos.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/cos.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id="function.cos"> <refnamediv> <refname>cos</refname> @@ -13,7 +13,21 @@ </methodsynopsis> <para> Restituisce il coseno di <parameter>arg</parameter>. Il parametro - <parameter>arg</parameter> edeve essere espresso in radianti. + <parameter>arg</parameter> deve essere espresso in radianti. + </para> + <para> + <example> + <title>Esempio di <function>cos</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo cos(M_PI); // -1 + +?> +]]> + </programlisting> + </example> </para> <para> Vedere anche <function>acos</function>, <function>sin</function>, Index: phpdoc-it/reference/math/functions/decbin.xml diff -u phpdoc-it/reference/math/functions/decbin.xml:1.3 phpdoc-it/reference/math/functions/decbin.xml:1.4 --- phpdoc-it/reference/math/functions/decbin.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/decbin.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: ready --> <refentry id="function.decbin"> <refnamediv> <refname>decbin</refname> @@ -17,7 +17,32 @@ 4294967295 in decimale, risultante in una stringa composta da 32 volte la cifra 1. </para> <para> - Vedere anche <function>bindec</function>. + <example> + <title>Esempio per <function>decbin</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo decbin(12) . "\n"; +echo decbin(26); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +1100 +11010 +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>bindec</function>, + <function>decoct</function>, + <function>dechex</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/dechex.xml diff -u phpdoc-it/reference/math/functions/dechex.xml:1.3 phpdoc-it/reference/math/functions/dechex.xml:1.4 --- phpdoc-it/reference/math/functions/dechex.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/dechex.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> <refentry id="function.dechex"> <refnamediv> <refname>dechex</refname> @@ -17,7 +17,32 @@ convertito è 2147483647 in decimale risultante in "7fffffff". </para> <para> - Vedere anche la funzione <function>hexdec</function>. + <example> + <title>Esempio per <function>dechex</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo dechex(10) . "\n"; +echo dechex(47); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +a +2f +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>hexdec</function>, + <function>decbin</function>, + <function>decoct</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/decoct.xml diff -u phpdoc-it/reference/math/functions/decoct.xml:1.3 phpdoc-it/reference/math/functions/decoct.xml:1.4 --- phpdoc-it/reference/math/functions/decoct.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/decoct.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> <refentry id="function.decoct"> <refnamediv> <refname>decoct</refname> @@ -17,7 +17,32 @@ 2147483647 in decimale risultante in "17777777777". Vedere anche <function>octdec</function>. </para> <para> - Vedere anche <function>octdec</function>. + <example> + <title>Esempio per <function>decoct</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo decoct(15) . "\n"; +echo decoct(264); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +17 +410 +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>octdec</function>, + <function>decbin</function>, + <function>dechex</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/deg2rad.xml diff -u phpdoc-it/reference/math/functions/deg2rad.xml:1.2 phpdoc-it/reference/math/functions/deg2rad.xml:1.3 --- phpdoc-it/reference/math/functions/deg2rad.xml:1.2 Wed Apr 17 03:07:18 2002 +++ phpdoc-it/reference/math/functions/deg2rad.xml Fri Jan 16 15:54:32 2004 @@ -1,8 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/math.xml, last change in rev 1.7 --> -<!-- last change to 'deg2rad' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> -<!-- OLD-Revision: 1.78/EN.1.2 --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> <refentry id="function.deg2rad"> <refnamediv> <refname>deg2rad</refname> @@ -21,6 +18,21 @@ al valore equivalente espresso in radianti. </para> <para> + <example> + <title>Esempio per <function>deg2rad</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo deg2rad(45); // 0.785398163397 +var_dump(deg2rad(45) === M_PI_4); // bool(true) + +?> +]]> + </programlisting> + </example> + </para> + <para> Vedere anche <function>rad2deg</function>. </para> </refsect1> Index: phpdoc-it/reference/math/functions/exp.xml diff -u phpdoc-it/reference/math/functions/exp.xml:1.3 phpdoc-it/reference/math/functions/exp.xml:1.4 --- phpdoc-it/reference/math/functions/exp.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/exp.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: ready --> <refentry id="function.exp"> <refnamediv> <refname>exp</refname> @@ -14,6 +14,34 @@ <para> Restituisce <constant>e</constant> elevato alla potenza di <parameter>arg</parameter>. </para> + <note> + <para> + 'e' è la base del sistema dei logaritmi dei numeri naturali, e vale + 2.718282. + </para> + </note> + <para> + <example> + <title>Esempio per <function>exp</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo exp(12) . "\n"; +echo exp(5.7); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +1.6275E+005 +298.87 +]]> + </screen> + </example> + </para> <para> Vedere anche <function>log</function> e Index: phpdoc-it/reference/math/functions/expm1.xml diff -u phpdoc-it/reference/math/functions/expm1.xml:1.3 phpdoc-it/reference/math/functions/expm1.xml:1.4 --- phpdoc-it/reference/math/functions/expm1.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/expm1.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id='function.expm1'> <refnamediv> <refname>expm1</refname> @@ -18,6 +18,7 @@ <para> &warn.undocumented.func; </para> + ¬e.no-windows; </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/hexdec.xml diff -u phpdoc-it/reference/math/functions/hexdec.xml:1.3 phpdoc-it/reference/math/functions/hexdec.xml:1.4 --- phpdoc-it/reference/math/functions/hexdec.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/hexdec.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <refentry id="function.hexdec"> <refnamediv> <refname>hexdec</refname> @@ -32,14 +32,17 @@ var_dump(hexdec("that")); var_dump(hexdec("a0")); -// entrambi stampano int(160) +// entrambi stampano "int(160)" ?> ]]> </programlisting> </example> </para> <para> - Vedere anche <function>dechex</function>. + Vedere anche <function>dechex</function>, + <function>bindec</function>, + <function>octdec</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/hypot.xml diff -u phpdoc-it/reference/math/functions/hypot.xml:1.2 phpdoc-it/reference/math/functions/hypot.xml:1.3 --- phpdoc-it/reference/math/functions/hypot.xml:1.2 Wed Apr 17 03:07:19 2002 +++ phpdoc-it/reference/math/functions/hypot.xml Fri Jan 16 15:54:32 2004 @@ -1,13 +1,10 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/math.xml, last change in rev 1.19 --> -<!-- last change to 'hypot' in en/ tree in rev 1.72 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> -<!-- OLD-Revision: 1.78/EN.1.72 --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> <refentry id='function.hypot'> <refnamediv> <refname>hypot</refname> <refpurpose> - Restituisce sqrt( num1*num1 + num2*num2) + Restituisce sqrt(num1*num1 + num2*num2) </refpurpose> </refnamediv> <refsect1> Index: phpdoc-it/reference/math/functions/is-finite.xml diff -u phpdoc-it/reference/math/functions/is-finite.xml:1.3 phpdoc-it/reference/math/functions/is-finite.xml:1.4 --- phpdoc-it/reference/math/functions/is-finite.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/is-finite.xml Fri Jan 16 15:54:32 2004 @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id='function.is-finite'> <refnamediv> <refname>is_finite</refname> - <refpurpose> - </refpurpose> + <refpurpose>Verifica se un numero dato è un numero finito</refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> Index: phpdoc-it/reference/math/functions/is-infinite.xml diff -u phpdoc-it/reference/math/functions/is-infinite.xml:1.3 phpdoc-it/reference/math/functions/is-infinite.xml:1.4 --- phpdoc-it/reference/math/functions/is-infinite.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/is-infinite.xml Fri Jan 16 15:54:32 2004 @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id='function.is-infinite'> <refnamediv> <refname>is_infinite</refname> - <refpurpose> - </refpurpose> + <refpurpose>Verifica se un dato valore è infinito</refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> Index: phpdoc-it/reference/math/functions/is-nan.xml diff -u phpdoc-it/reference/math/functions/is-nan.xml:1.3 phpdoc-it/reference/math/functions/is-nan.xml:1.4 --- phpdoc-it/reference/math/functions/is-nan.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/is-nan.xml Fri Jan 16 15:54:32 2004 @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id='function.is-nan'> <refnamediv> <refname>is_nan</refname> - <refpurpose> - </refpurpose> + <refpurpose>Verifica se un dato valore non sia un numero</refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> Index: phpdoc-it/reference/math/functions/log1p.xml diff -u phpdoc-it/reference/math/functions/log1p.xml:1.2 phpdoc-it/reference/math/functions/log1p.xml:1.3 --- phpdoc-it/reference/math/functions/log1p.xml:1.2 Wed Apr 17 03:07:20 2002 +++ phpdoc-it/reference/math/functions/log1p.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'log1p' in en/ tree in rev 1.63 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.63 --> <refentry id='function.log1p'> <refnamediv> @@ -21,6 +21,7 @@ <para> &warn.undocumented.func; </para> + ¬e.no-windows; </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/mt-rand.xml diff -u phpdoc-it/reference/math/functions/mt-rand.xml:1.3 phpdoc-it/reference/math/functions/mt-rand.xml:1.4 --- phpdoc-it/reference/math/functions/mt-rand.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/mt-rand.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: ready --> <refentry id="function.mt-rand"> <refnamediv> <refname>mt_rand</refname> @@ -31,7 +31,30 @@ compreso fra 5 e 15 (inclusi), usare <literal>mt_rand (5, 15)</literal>. </simpara> - + <para> + <example> + <title>Esempio per <function>mt_rand</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo mt_rand() . "\n"; +echo mt_rand() . "\n"; +echo mt_rand(5, 15); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà qualcosa simile a: + </para> + <screen> +<![CDATA[ +1604716014 +1478613278 +6 +]]> + </screen> + </example> + </para> ¬e.randomseed; <note> Index: phpdoc-it/reference/math/functions/mt-srand.xml diff -u phpdoc-it/reference/math/functions/mt-srand.xml:1.3 phpdoc-it/reference/math/functions/mt-srand.xml:1.4 --- phpdoc-it/reference/math/functions/mt-srand.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/mt-srand.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <refentry id="function.mt-srand"> <refnamediv> <refname>mt_srand</refname> @@ -9,11 +9,13 @@ <title>Descrizione</title> <methodsynopsis> <type>void</type><methodname>mt_srand</methodname> - <methodparam><type>int</type><parameter>seme</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>seme</parameter></methodparam> </methodsynopsis> <para> Inizializza il generatore di numeri casuali con il parametro <parameter>seme</parameter>. + A partire dalla versione 4.2.0 di PHP il parametro <parameter>seme</parameter> è + diventato opzionale, e, per default, viene impostato ad un valore random. <informalexample> <programlisting role="php"> <![CDATA[ Index: phpdoc-it/reference/math/functions/octdec.xml diff -u phpdoc-it/reference/math/functions/octdec.xml:1.2 phpdoc-it/reference/math/functions/octdec.xml:1.3 --- phpdoc-it/reference/math/functions/octdec.xml:1.2 Wed Apr 17 03:07:21 2002 +++ phpdoc-it/reference/math/functions/octdec.xml Fri Jan 16 15:54:32 2004 @@ -1,8 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> -<!-- last change to 'octdec' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> -<!-- OLD-Revision: 1.78/EN.1.2 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id="function.octdec"> <refnamediv> <refname>octdec</refname> @@ -22,7 +19,32 @@ decimale. </para> <para> - Vedere anche <function>decoct</function>. + <example> + <title>Esempio per <function>octdec</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo octdec('77') . "\n"; +echo octdec(decoct(45)); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +63 +45 +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>decoct</function>, + <function>bindec</function>, + <function>hexdec</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/pow.xml diff -u phpdoc-it/reference/math/functions/pow.xml:1.2 phpdoc-it/reference/math/functions/pow.xml:1.3 --- phpdoc-it/reference/math/functions/pow.xml:1.2 Wed Apr 17 03:07:21 2002 +++ phpdoc-it/reference/math/functions/pow.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'pow' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.pow"> <refnamediv> @@ -30,8 +30,8 @@ <![CDATA[ <?php -var_dump( pow(2,8) ); // int(256) -echo pow(-1,20); // 1 +var_dump( pow(2,8)); // int(256) +echo pow(-1, 20); // 1 echo pow(0, 0); // 1 echo pow(-1, 5.5); // errore Index: phpdoc-it/reference/math/functions/rad2deg.xml diff -u phpdoc-it/reference/math/functions/rad2deg.xml:1.2 phpdoc-it/reference/math/functions/rad2deg.xml:1.3 --- phpdoc-it/reference/math/functions/rad2deg.xml:1.2 Wed Apr 17 03:07:21 2002 +++ phpdoc-it/reference/math/functions/rad2deg.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.7 --> <!-- last change to 'rad2deg' in en/ tree in rev 1.8 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.8 --> <refentry id="function.rad2deg"> <refnamediv> @@ -20,6 +20,20 @@ Questa funzione converte <parameter>numero</parameter> da radianti a gradi. </para> + <para> + <example> + <title>Esempio per <function>rad2deg</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo rad2deg(M_PI_4); // 45 + +?> +]]> + </programlisting> + </example> + </para> <para> Vedere anche <function>deg2rad</function>. </para> Index: phpdoc-it/reference/math/functions/rand.xml diff -u phpdoc-it/reference/math/functions/rand.xml:1.3 phpdoc-it/reference/math/functions/rand.xml:1.4 --- phpdoc-it/reference/math/functions/rand.xml:1.3 Fri Oct 10 15:48:16 2003 +++ phpdoc-it/reference/math/functions/rand.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: cortesi Status: ready --> <refentry id="function.rand"> <refnamediv> <refname>rand</refname> @@ -20,6 +20,30 @@ compreso fra 5 e 15 (inclusi) usare <literal>rand (5, 15)</literal>. </simpara> + <para> + <example> + <title>Esempio per <function>rand</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo rand() . "\n"; +echo rand() . "\n"; +echo rand(5, 15); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà qualcosa simile a: + </para> + <screen> +<![CDATA[ +7771 +22264 +11 +]]> + </screen> + </example> + </para> <note> <simpara> Su alcune piattaforme (come Windows) <constant>RAND_MAX</constant> Index: phpdoc-it/reference/math/functions/round.xml diff -u phpdoc-it/reference/math/functions/round.xml:1.2 phpdoc-it/reference/math/functions/round.xml:1.3 --- phpdoc-it/reference/math/functions/round.xml:1.2 Wed Apr 17 03:07:21 2002 +++ phpdoc-it/reference/math/functions/round.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'round' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.round"> <refnamediv> @@ -19,42 +19,64 @@ Restituisce il valore arrotondato di <parameter>val</parameter> con la <parameter>precisione</parameter> specificata (numero di cifre dopo il punto decimale). - <parameter>precision</parameter> può anche essere negativa o zero (predefinito). + <parameter>precisione</parameter> può anche essere negativa o zero (predefinito). </para> <para> + <example> + <title><function>round</function> examples</title> + <programlisting role="php"> +<![CDATA[ +<?php +echo round(3.4); // 3 +echo round(3.5); // 4 +echo round(3.6); // 4 +echo round(3.6, 0); // 4 +echo round(1.95583, 2); // 1.96 +echo round(1241757, -3); // 1242000 +echo round(5.045, 2); // 5.04 +echo round(5.055, 2); // 5.06 +?> +]]> + </programlisting> + </example> + </para> + <!-- It's not true + <para> <caution> <simpara> - Il PHP non maneggia correttamente stringhe quali <literal>"12,300.2"</literal> - in maniera predefinita. Fare riferimento a <link linkend="language.types.string.conversion" - >conversione da stringhe</link>. + When rounding on exact halves <function>round</function> rounds down on + evens and up on odds. If you want to always force it in one direction + on a .5 (or .05 in your case) add or substract a tiny fuzz factor. The + reason behind rounding half the values down and the other half up is to + avoid the classical banking problem where if you always rounded down + you would be stealing money from your customers, or if you always + rounded up you would end up over time losing money. By averaging it + out through evens and odds you statistically break even. </simpara> </caution> </para> + --> <para> - <informalexample> - <programlisting> -<![CDATA[ -$foo = round (3.4); // $foo == 3.0 -$foo = round (3.5); // $foo == 4.0 -$foo = round (3.6); // $foo == 4.0 -$foo = round(3.6, 0); // equivalente alla riga sopra - -$foo = round (1.95583, 2); // $foo == 1.96 - -$foo = round(1241757, -3); // $foo == 1242000 -]]> - </programlisting> - </informalexample> + <note> + <simpara> + Il PHP non maneggia correttamente stringhe quali <literal>"12,300.2"</literal> + in maniera predefinita. Fare riferimento a <link linkend="language.types.string.conversion"> + conversione da stringhe</link>. + </simpara> + </note> + </para> + <para> + <note> + <simpara> + Il parametro <parameter>precisione</parameter> è disponibile + solo nel PHP 4. + </simpara> + </note> </para> - <note> - <simpara> - Il parametro <parameter>precisione</parameter> è disponibile - solo nel PHP 4. - </simpara> - </note> <simpara> - Vedere anche <function>ceil</function> e - <function>floor</function>. + Vedere anche <function>ceil</function>, + <function>floor</function> e + <function>number_format</function>. </simpara> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/sin.xml diff -u phpdoc-it/reference/math/functions/sin.xml:1.3 phpdoc-it/reference/math/functions/sin.xml:1.4 --- phpdoc-it/reference/math/functions/sin.xml:1.3 Fri Oct 10 15:48:16 2003 +++ phpdoc-it/reference/math/functions/sin.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <refentry id="function.sin"> <refnamediv> <refname>sin</refname> @@ -22,8 +22,8 @@ <?php // La precisione dipende dalle direttive di precisione -print sin(deg2rad(60)); // 0.866025403 ... -print sin(60); // -0.304810621 ... +echo sin(deg2rad(60)); // 0.866025403 ... +echo sin(60); // -0.304810621 ... ?> ]]> Index: phpdoc-it/reference/math/functions/sqrt.xml diff -u phpdoc-it/reference/math/functions/sqrt.xml:1.2 phpdoc-it/reference/math/functions/sqrt.xml:1.3 --- phpdoc-it/reference/math/functions/sqrt.xml:1.2 Wed Apr 17 03:07:22 2002 +++ phpdoc-it/reference/math/functions/sqrt.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'sqrt' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.sqrt"> <refnamediv> @@ -16,6 +16,19 @@ </methodsynopsis> <para> Restituisce la radice quadrata di <parameter>arg</parameter>. + </para> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +// La precisione dipende dalle impostazioni delle direttive sulla precisione +echo sqrt(9); // 3 +echo sqrt(10); // 3.16227766 ... +?> +]]> + </programlisting> + </informalexample> </para> <para> Vedere anche <function>pow</function>. Index: phpdoc-it/reference/math/functions/srand.xml diff -u phpdoc-it/reference/math/functions/srand.xml:1.2 phpdoc-it/reference/math/functions/srand.xml:1.3 --- phpdoc-it/reference/math/functions/srand.xml:1.2 Wed Apr 17 03:07:22 2002 +++ phpdoc-it/reference/math/functions/srand.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?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 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.srand"> <refnamediv> @@ -12,14 +12,17 @@ <title>Descrizione</title> <methodsynopsis> <type>void</type><methodname>srand</methodname> - <methodparam><type>int</type><parameter>seme</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>seme</parameter></methodparam> </methodsynopsis> <para> - Inizializza il generatore di num casuali con - <parameter>seme</parameter>. + Inizializza il generatore di numeri casuali con + <parameter>seme</parameter>. A partire dalla versione 4.2.0 di PHP + il parametro <parameter>seme</parameter> è opzionale, e per default + viene impostato ad un valore casuale. <informalexample> <programlisting> <![CDATA[ +<?php // inizializza usando i microsecondi function crea_seme() { list($usec, $sec) = explode(' ', microtime()); @@ -27,15 +30,17 @@ } srand((double)microtime()*1000000); $valorecasuale = rand(); +?> ]]> </programlisting> </informalexample> </para> + + ¬e.randomseed; + <simpara> Vedere anche <function>rand</function>, - <function>getrandmax</function>, <function>mt_rand</function>, - <function>mt_srand</function> e - <function>mt_getrandmax</function>. + <function>getrandmax</function> e <function>mt_srand</function>. </simpara> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/tan.xml diff -u phpdoc-it/reference/math/functions/tan.xml:1.2 phpdoc-it/reference/math/functions/tan.xml:1.3 --- phpdoc-it/reference/math/functions/tan.xml:1.2 Wed Apr 17 03:07:22 2002 +++ phpdoc-it/reference/math/functions/tan.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'tan' in en/ tree in rev 1.57 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.57 --> <refentry id="function.tan"> <refnamediv> @@ -15,10 +15,26 @@ <methodparam><type>float</type><parameter>arg</parameter></methodparam> </methodsynopsis> <para> - Restituisce la tangente di arg in radianti. + La funzione <function>tan</function> restituisce la tangente del parametro <parameter>arg</parameter>. + Il parametro <parameter>arg</parameter> deve essere espresso in radianti. </para> <para> - Vedere anche <function>sin</function> e <function>cos</function>. + <example> + <title>Esempio per <function>tan</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo tan(M_PI_2); // 1 + +?> +]]> + </programlisting> + </example> + </para> + <para> + Vedere anche <function>atan</function>, <function>sin</function>, + <function>cos</function> e <function>deg2rad</function>. </para> </refsect1> </refentry>
Index: phpdoc-it/reference/math/reference.xml diff -u phpdoc-it/reference/math/reference.xml:1.4 phpdoc-it/reference/math/reference.xml:1.5 --- phpdoc-it/reference/math/reference.xml:1.4 Tue Jun 4 09:24:26 2002 +++ phpdoc-it/reference/math/reference.xml Fri Jan 16 15:54:31 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <reference id="ref.math"> <title>Funzioni Matematiche</title> <titleabbrev>Mat</titleabbrev> @@ -14,119 +14,36 @@ Se si ha necessità di lavorare con numeri più grandi, fare riferimento alle <link linkend="ref.bc">funzioni matematiche a precisione arbitraria</link>. </para> - <section id="math.constants"> - &reftitle.constants; - <para> - I seguenti valori sono definiti come costanti nel PHP dall'estensione - matematica del linguaggio: - <table> - <title>Costanti Matematiche</title> - <tgroup cols="3"> - <thead> - <row> - <entry>Costante</entry> - <entry>Valore</entry> - <entry>Descrizione</entry> - </row> - </thead> - <tbody> - <row> - <entry>M_PI</entry> - <entry>3.14159265358979323846</entry> - <entry>Pi</entry> - </row> - <row> - <entry>M_E</entry> - <entry>2.7182818284590452354</entry> - <entry>e</entry> - </row> - <row> - <entry>M_LOG2E</entry> - <entry>1.4426950408889634074</entry> - <entry>log_2 e</entry> - </row> - <row> - <entry>M_LOG10E</entry> - <entry>0.43429448190325182765</entry> - <entry>log_10 e</entry> - </row> - <row> - <entry>M_LN2</entry> - <entry>0.69314718055994530942</entry> - <entry>log_e 2</entry> - </row> - <row> - <entry>M_LN10</entry> - <entry>2.30258509299404568402</entry> - <entry>log_e 10</entry> - </row> - <row> - <entry>M_PI_2</entry> - <entry>1.57079632679489661923</entry> - <entry>pi/2</entry> - </row> - <row> - <entry>M_PI_4</entry> - <entry>0.78539816339744830962</entry> - <entry>pi/4</entry> - </row> - <row> - <entry>M_1_PI</entry> - <entry>0.31830988618379067154</entry> - <entry>1/pi</entry> - </row> - <row> - <entry>M_2_PI</entry> - <entry>0.63661977236758134308</entry> - <entry>2/pi</entry> - </row> - <row> - <entry>M_SQRTPI</entry> - <entry>1.77245385090551602729</entry> - <entry>sqrt(pi) [4.0.2]</entry> - </row> - <row> - <entry>M_2_SQRTPI</entry> - <entry>1.12837916709551257390</entry> - <entry>2/sqrt(pi)</entry> - </row> - <row> - <entry>M_SQRT2</entry> - <entry>1.41421356237309504880</entry> - <entry>sqrt(2)</entry> - </row> - <row> - <entry>M_SQRT3</entry> - <entry>1.73205080756887729352</entry> - <entry>sqrt(3) [4.0.2]</entry> - </row> - <row> - <entry>M_SQRT1_2</entry> - <entry>0.70710678118654752440</entry> - <entry>1/sqrt(2)</entry> - </row> - <row> - <entry>M_LNPI</entry> - <entry>1.14472988584940017414</entry> - <entry>log_e(pi) [4.0.2]</entry> - </row> - <row> - <entry>M_EULER</entry> - <entry>0.57721566490153286061</entry> - <entry>Costante di Eulero [4.0.2]</entry> - </row> - </tbody> - </tgroup> - </table> - Soltanto M_PI è disponibile nelle versioni precedenti alla PHP 4.0.0 (compresa). - Tutte le rimanenti costanti sono disponibili a partire dal PHP 4.0.0. Le costanti - indicate con [4.0.2] sono state aggiunte nel PHP 4.0.2. - </para> - </section> + <simpara> + Vedere anche il manuale alle pagine <link linkend="language.operators.arithmetic">operatori + aritmetici</link>. + </simpara> </section> + + <section id="math.requirements"> + &reftitle.required; + &no.requirement; + </section> + + <section id="math.installation"> + &reftitle.install; + &no.install; + </section> + + <section id="math.configuration"> + &reftitle.runtime; + &no.config; + </section> + + <section id="math.resources"> + &reftitle.resources; + &no.resource; + </section> + + &reference.math.constants; </partintro> -&reference.math.functions; + &reference.math.functions; </reference> <!-- Keep this comment at the end of the file Index: phpdoc-it/reference/math/functions/abs.xml diff -u phpdoc-it/reference/math/functions/abs.xml:1.3 phpdoc-it/reference/math/functions/abs.xml:1.4 --- phpdoc-it/reference/math/functions/abs.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/abs.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> <refentry id="function.abs"> <refnamediv> <refname>abs</refname> @@ -8,7 +8,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>mixed</type><methodname>abs</methodname> + <type>number</type><methodname>abs</methodname> <methodparam><type>mixed</type><parameter>numero</parameter></methodparam> </methodsynopsis> <para> Index: phpdoc-it/reference/math/functions/atan2.xml diff -u phpdoc-it/reference/math/functions/atan2.xml:1.2 phpdoc-it/reference/math/functions/atan2.xml:1.3 --- phpdoc-it/reference/math/functions/atan2.xml:1.2 Wed Apr 17 03:07:16 2002 +++ phpdoc-it/reference/math/functions/atan2.xml Fri Jan 16 15:54:32 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'atan2' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.atan2"> <refnamediv> <refname>atan2</refname> - <refpurpose>arco tangente di due variabili</refpurpose> + <refpurpose>Arco tangente di due variabili</refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> Index: phpdoc-it/reference/math/functions/bindec.xml diff -u phpdoc-it/reference/math/functions/bindec.xml:1.3 phpdoc-it/reference/math/functions/bindec.xml:1.4 --- phpdoc-it/reference/math/functions/bindec.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/bindec.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> <refentry id="function.bindec"> <refnamediv> <refname>bindec</refname> @@ -21,8 +21,35 @@ essere convertito è 31 volte la cifra 1 oppure 2147483647 espresso in formato decimale. </para> <para> - Vedere anche - <function>decbin</function>. + <example> + <title>Esempio di <function>bindec</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo bindec('110011') . "\n"; +echo bindec('000110011') . "\n"; + +echo bindec('111'); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +51 +51 +7 +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>decbin</function>, + <function>octdec</function>, + <function>hexdec</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/cos.xml diff -u phpdoc-it/reference/math/functions/cos.xml:1.3 phpdoc-it/reference/math/functions/cos.xml:1.4 --- phpdoc-it/reference/math/functions/cos.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/cos.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id="function.cos"> <refnamediv> <refname>cos</refname> @@ -13,7 +13,21 @@ </methodsynopsis> <para> Restituisce il coseno di <parameter>arg</parameter>. Il parametro - <parameter>arg</parameter> edeve essere espresso in radianti. + <parameter>arg</parameter> deve essere espresso in radianti. + </para> + <para> + <example> + <title>Esempio di <function>cos</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo cos(M_PI); // -1 + +?> +]]> + </programlisting> + </example> </para> <para> Vedere anche <function>acos</function>, <function>sin</function>, Index: phpdoc-it/reference/math/functions/decbin.xml diff -u phpdoc-it/reference/math/functions/decbin.xml:1.3 phpdoc-it/reference/math/functions/decbin.xml:1.4 --- phpdoc-it/reference/math/functions/decbin.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/decbin.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: ready --> <refentry id="function.decbin"> <refnamediv> <refname>decbin</refname> @@ -17,7 +17,32 @@ 4294967295 in decimale, risultante in una stringa composta da 32 volte la cifra 1. </para> <para> - Vedere anche <function>bindec</function>. + <example> + <title>Esempio per <function>decbin</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo decbin(12) . "\n"; +echo decbin(26); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +1100 +11010 +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>bindec</function>, + <function>decoct</function>, + <function>dechex</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/dechex.xml diff -u phpdoc-it/reference/math/functions/dechex.xml:1.3 phpdoc-it/reference/math/functions/dechex.xml:1.4 --- phpdoc-it/reference/math/functions/dechex.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/dechex.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> <refentry id="function.dechex"> <refnamediv> <refname>dechex</refname> @@ -17,7 +17,32 @@ convertito è 2147483647 in decimale risultante in "7fffffff". </para> <para> - Vedere anche la funzione <function>hexdec</function>. + <example> + <title>Esempio per <function>dechex</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo dechex(10) . "\n"; +echo dechex(47); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +a +2f +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>hexdec</function>, + <function>decbin</function>, + <function>decoct</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/decoct.xml diff -u phpdoc-it/reference/math/functions/decoct.xml:1.3 phpdoc-it/reference/math/functions/decoct.xml:1.4 --- phpdoc-it/reference/math/functions/decoct.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/decoct.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> <refentry id="function.decoct"> <refnamediv> <refname>decoct</refname> @@ -17,7 +17,32 @@ 2147483647 in decimale risultante in "17777777777". Vedere anche <function>octdec</function>. </para> <para> - Vedere anche <function>octdec</function>. + <example> + <title>Esempio per <function>decoct</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo decoct(15) . "\n"; +echo decoct(264); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +17 +410 +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>octdec</function>, + <function>decbin</function>, + <function>dechex</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/deg2rad.xml diff -u phpdoc-it/reference/math/functions/deg2rad.xml:1.2 phpdoc-it/reference/math/functions/deg2rad.xml:1.3 --- phpdoc-it/reference/math/functions/deg2rad.xml:1.2 Wed Apr 17 03:07:18 2002 +++ phpdoc-it/reference/math/functions/deg2rad.xml Fri Jan 16 15:54:32 2004 @@ -1,8 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/math.xml, last change in rev 1.7 --> -<!-- last change to 'deg2rad' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> -<!-- OLD-Revision: 1.78/EN.1.2 --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> <refentry id="function.deg2rad"> <refnamediv> <refname>deg2rad</refname> @@ -21,6 +18,21 @@ al valore equivalente espresso in radianti. </para> <para> + <example> + <title>Esempio per <function>deg2rad</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo deg2rad(45); // 0.785398163397 +var_dump(deg2rad(45) === M_PI_4); // bool(true) + +?> +]]> + </programlisting> + </example> + </para> + <para> Vedere anche <function>rad2deg</function>. </para> </refsect1> Index: phpdoc-it/reference/math/functions/exp.xml diff -u phpdoc-it/reference/math/functions/exp.xml:1.3 phpdoc-it/reference/math/functions/exp.xml:1.4 --- phpdoc-it/reference/math/functions/exp.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/exp.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: ready --> <refentry id="function.exp"> <refnamediv> <refname>exp</refname> @@ -14,6 +14,34 @@ <para> Restituisce <constant>e</constant> elevato alla potenza di <parameter>arg</parameter>. </para> + <note> + <para> + 'e' è la base del sistema dei logaritmi dei numeri naturali, e vale + 2.718282. + </para> + </note> + <para> + <example> + <title>Esempio per <function>exp</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo exp(12) . "\n"; +echo exp(5.7); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +1.6275E+005 +298.87 +]]> + </screen> + </example> + </para> <para> Vedere anche <function>log</function> e Index: phpdoc-it/reference/math/functions/expm1.xml diff -u phpdoc-it/reference/math/functions/expm1.xml:1.3 phpdoc-it/reference/math/functions/expm1.xml:1.4 --- phpdoc-it/reference/math/functions/expm1.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/expm1.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id='function.expm1'> <refnamediv> <refname>expm1</refname> @@ -18,6 +18,7 @@ <para> &warn.undocumented.func; </para> + ¬e.no-windows; </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/hexdec.xml diff -u phpdoc-it/reference/math/functions/hexdec.xml:1.3 phpdoc-it/reference/math/functions/hexdec.xml:1.4 --- phpdoc-it/reference/math/functions/hexdec.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/hexdec.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <refentry id="function.hexdec"> <refnamediv> <refname>hexdec</refname> @@ -32,14 +32,17 @@ var_dump(hexdec("that")); var_dump(hexdec("a0")); -// entrambi stampano int(160) +// entrambi stampano "int(160)" ?> ]]> </programlisting> </example> </para> <para> - Vedere anche <function>dechex</function>. + Vedere anche <function>dechex</function>, + <function>bindec</function>, + <function>octdec</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/hypot.xml diff -u phpdoc-it/reference/math/functions/hypot.xml:1.2 phpdoc-it/reference/math/functions/hypot.xml:1.3 --- phpdoc-it/reference/math/functions/hypot.xml:1.2 Wed Apr 17 03:07:19 2002 +++ phpdoc-it/reference/math/functions/hypot.xml Fri Jan 16 15:54:32 2004 @@ -1,13 +1,10 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/math.xml, last change in rev 1.19 --> -<!-- last change to 'hypot' in en/ tree in rev 1.72 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> -<!-- OLD-Revision: 1.78/EN.1.72 --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> <refentry id='function.hypot'> <refnamediv> <refname>hypot</refname> <refpurpose> - Restituisce sqrt( num1*num1 + num2*num2) + Restituisce sqrt(num1*num1 + num2*num2) </refpurpose> </refnamediv> <refsect1> Index: phpdoc-it/reference/math/functions/is-finite.xml diff -u phpdoc-it/reference/math/functions/is-finite.xml:1.3 phpdoc-it/reference/math/functions/is-finite.xml:1.4 --- phpdoc-it/reference/math/functions/is-finite.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/is-finite.xml Fri Jan 16 15:54:32 2004 @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id='function.is-finite'> <refnamediv> <refname>is_finite</refname> - <refpurpose> - </refpurpose> + <refpurpose>Verifica se un numero dato è un numero finito</refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> Index: phpdoc-it/reference/math/functions/is-infinite.xml diff -u phpdoc-it/reference/math/functions/is-infinite.xml:1.3 phpdoc-it/reference/math/functions/is-infinite.xml:1.4 --- phpdoc-it/reference/math/functions/is-infinite.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/is-infinite.xml Fri Jan 16 15:54:32 2004 @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id='function.is-infinite'> <refnamediv> <refname>is_infinite</refname> - <refpurpose> - </refpurpose> + <refpurpose>Verifica se un dato valore è infinito</refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> Index: phpdoc-it/reference/math/functions/is-nan.xml diff -u phpdoc-it/reference/math/functions/is-nan.xml:1.3 phpdoc-it/reference/math/functions/is-nan.xml:1.4 --- phpdoc-it/reference/math/functions/is-nan.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/is-nan.xml Fri Jan 16 15:54:32 2004 @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id='function.is-nan'> <refnamediv> <refname>is_nan</refname> - <refpurpose> - </refpurpose> + <refpurpose>Verifica se un dato valore non sia un numero</refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> Index: phpdoc-it/reference/math/functions/log1p.xml diff -u phpdoc-it/reference/math/functions/log1p.xml:1.2 phpdoc-it/reference/math/functions/log1p.xml:1.3 --- phpdoc-it/reference/math/functions/log1p.xml:1.2 Wed Apr 17 03:07:20 2002 +++ phpdoc-it/reference/math/functions/log1p.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'log1p' in en/ tree in rev 1.63 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.63 --> <refentry id='function.log1p'> <refnamediv> @@ -21,6 +21,7 @@ <para> &warn.undocumented.func; </para> + ¬e.no-windows; </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/mt-rand.xml diff -u phpdoc-it/reference/math/functions/mt-rand.xml:1.3 phpdoc-it/reference/math/functions/mt-rand.xml:1.4 --- phpdoc-it/reference/math/functions/mt-rand.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/mt-rand.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: ready --> <refentry id="function.mt-rand"> <refnamediv> <refname>mt_rand</refname> @@ -31,7 +31,30 @@ compreso fra 5 e 15 (inclusi), usare <literal>mt_rand (5, 15)</literal>. </simpara> - + <para> + <example> + <title>Esempio per <function>mt_rand</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo mt_rand() . "\n"; +echo mt_rand() . "\n"; +echo mt_rand(5, 15); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà qualcosa simile a: + </para> + <screen> +<![CDATA[ +1604716014 +1478613278 +6 +]]> + </screen> + </example> + </para> ¬e.randomseed; <note> Index: phpdoc-it/reference/math/functions/mt-srand.xml diff -u phpdoc-it/reference/math/functions/mt-srand.xml:1.3 phpdoc-it/reference/math/functions/mt-srand.xml:1.4 --- phpdoc-it/reference/math/functions/mt-srand.xml:1.3 Fri Oct 3 15:27:43 2003 +++ phpdoc-it/reference/math/functions/mt-srand.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <refentry id="function.mt-srand"> <refnamediv> <refname>mt_srand</refname> @@ -9,11 +9,13 @@ <title>Descrizione</title> <methodsynopsis> <type>void</type><methodname>mt_srand</methodname> - <methodparam><type>int</type><parameter>seme</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>seme</parameter></methodparam> </methodsynopsis> <para> Inizializza il generatore di numeri casuali con il parametro <parameter>seme</parameter>. + A partire dalla versione 4.2.0 di PHP il parametro <parameter>seme</parameter> è + diventato opzionale, e, per default, viene impostato ad un valore random. <informalexample> <programlisting role="php"> <![CDATA[ Index: phpdoc-it/reference/math/functions/octdec.xml diff -u phpdoc-it/reference/math/functions/octdec.xml:1.2 phpdoc-it/reference/math/functions/octdec.xml:1.3 --- phpdoc-it/reference/math/functions/octdec.xml:1.2 Wed Apr 17 03:07:21 2002 +++ phpdoc-it/reference/math/functions/octdec.xml Fri Jan 16 15:54:32 2004 @@ -1,8 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> -<!-- last change to 'octdec' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> -<!-- OLD-Revision: 1.78/EN.1.2 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <refentry id="function.octdec"> <refnamediv> <refname>octdec</refname> @@ -22,7 +19,32 @@ decimale. </para> <para> - Vedere anche <function>decoct</function>. + <example> + <title>Esempio per <function>octdec</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo octdec('77') . "\n"; +echo octdec(decoct(45)); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà: + </para> + <screen> +<![CDATA[ +63 +45 +]]> + </screen> + </example> + </para> + <para> + Vedere anche <function>decoct</function>, + <function>bindec</function>, + <function>hexdec</function> e + <function>base_convert</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/pow.xml diff -u phpdoc-it/reference/math/functions/pow.xml:1.2 phpdoc-it/reference/math/functions/pow.xml:1.3 --- phpdoc-it/reference/math/functions/pow.xml:1.2 Wed Apr 17 03:07:21 2002 +++ phpdoc-it/reference/math/functions/pow.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'pow' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.pow"> <refnamediv> @@ -30,8 +30,8 @@ <![CDATA[ <?php -var_dump( pow(2,8) ); // int(256) -echo pow(-1,20); // 1 +var_dump( pow(2,8)); // int(256) +echo pow(-1, 20); // 1 echo pow(0, 0); // 1 echo pow(-1, 5.5); // errore Index: phpdoc-it/reference/math/functions/rad2deg.xml diff -u phpdoc-it/reference/math/functions/rad2deg.xml:1.2 phpdoc-it/reference/math/functions/rad2deg.xml:1.3 --- phpdoc-it/reference/math/functions/rad2deg.xml:1.2 Wed Apr 17 03:07:21 2002 +++ phpdoc-it/reference/math/functions/rad2deg.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.7 --> <!-- last change to 'rad2deg' in en/ tree in rev 1.8 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.8 --> <refentry id="function.rad2deg"> <refnamediv> @@ -20,6 +20,20 @@ Questa funzione converte <parameter>numero</parameter> da radianti a gradi. </para> + <para> + <example> + <title>Esempio per <function>rad2deg</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo rad2deg(M_PI_4); // 45 + +?> +]]> + </programlisting> + </example> + </para> <para> Vedere anche <function>deg2rad</function>. </para> Index: phpdoc-it/reference/math/functions/rand.xml diff -u phpdoc-it/reference/math/functions/rand.xml:1.3 phpdoc-it/reference/math/functions/rand.xml:1.4 --- phpdoc-it/reference/math/functions/rand.xml:1.3 Fri Oct 10 15:48:16 2003 +++ phpdoc-it/reference/math/functions/rand.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: cortesi Status: ready --> <refentry id="function.rand"> <refnamediv> <refname>rand</refname> @@ -20,6 +20,30 @@ compreso fra 5 e 15 (inclusi) usare <literal>rand (5, 15)</literal>. </simpara> + <para> + <example> + <title>Esempio per <function>rand</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo rand() . "\n"; +echo rand() . "\n"; +echo rand(5, 15); +?> +]]> + </programlisting> + <para> + L'esempio precedente visualizzerà qualcosa simile a: + </para> + <screen> +<![CDATA[ +7771 +22264 +11 +]]> + </screen> + </example> + </para> <note> <simpara> Su alcune piattaforme (come Windows) <constant>RAND_MAX</constant> Index: phpdoc-it/reference/math/functions/round.xml diff -u phpdoc-it/reference/math/functions/round.xml:1.2 phpdoc-it/reference/math/functions/round.xml:1.3 --- phpdoc-it/reference/math/functions/round.xml:1.2 Wed Apr 17 03:07:21 2002 +++ phpdoc-it/reference/math/functions/round.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'round' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.round"> <refnamediv> @@ -19,42 +19,64 @@ Restituisce il valore arrotondato di <parameter>val</parameter> con la <parameter>precisione</parameter> specificata (numero di cifre dopo il punto decimale). - <parameter>precision</parameter> può anche essere negativa o zero (predefinito). + <parameter>precisione</parameter> può anche essere negativa o zero (predefinito). </para> <para> + <example> + <title><function>round</function> examples</title> + <programlisting role="php"> +<![CDATA[ +<?php +echo round(3.4); // 3 +echo round(3.5); // 4 +echo round(3.6); // 4 +echo round(3.6, 0); // 4 +echo round(1.95583, 2); // 1.96 +echo round(1241757, -3); // 1242000 +echo round(5.045, 2); // 5.04 +echo round(5.055, 2); // 5.06 +?> +]]> + </programlisting> + </example> + </para> + <!-- It's not true + <para> <caution> <simpara> - Il PHP non maneggia correttamente stringhe quali <literal>"12,300.2"</literal> - in maniera predefinita. Fare riferimento a <link linkend="language.types.string.conversion" - >conversione da stringhe</link>. + When rounding on exact halves <function>round</function> rounds down on + evens and up on odds. If you want to always force it in one direction + on a .5 (or .05 in your case) add or substract a tiny fuzz factor. The + reason behind rounding half the values down and the other half up is to + avoid the classical banking problem where if you always rounded down + you would be stealing money from your customers, or if you always + rounded up you would end up over time losing money. By averaging it + out through evens and odds you statistically break even. </simpara> </caution> </para> + --> <para> - <informalexample> - <programlisting> -<![CDATA[ -$foo = round (3.4); // $foo == 3.0 -$foo = round (3.5); // $foo == 4.0 -$foo = round (3.6); // $foo == 4.0 -$foo = round(3.6, 0); // equivalente alla riga sopra - -$foo = round (1.95583, 2); // $foo == 1.96 - -$foo = round(1241757, -3); // $foo == 1242000 -]]> - </programlisting> - </informalexample> + <note> + <simpara> + Il PHP non maneggia correttamente stringhe quali <literal>"12,300.2"</literal> + in maniera predefinita. Fare riferimento a <link linkend="language.types.string.conversion"> + conversione da stringhe</link>. + </simpara> + </note> + </para> + <para> + <note> + <simpara> + Il parametro <parameter>precisione</parameter> è disponibile + solo nel PHP 4. + </simpara> + </note> </para> - <note> - <simpara> - Il parametro <parameter>precisione</parameter> è disponibile - solo nel PHP 4. - </simpara> - </note> <simpara> - Vedere anche <function>ceil</function> e - <function>floor</function>. + Vedere anche <function>ceil</function>, + <function>floor</function> e + <function>number_format</function>. </simpara> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/sin.xml diff -u phpdoc-it/reference/math/functions/sin.xml:1.3 phpdoc-it/reference/math/functions/sin.xml:1.4 --- phpdoc-it/reference/math/functions/sin.xml:1.3 Fri Oct 10 15:48:16 2003 +++ phpdoc-it/reference/math/functions/sin.xml Fri Jan 16 15:54:32 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <refentry id="function.sin"> <refnamediv> <refname>sin</refname> @@ -22,8 +22,8 @@ <?php // La precisione dipende dalle direttive di precisione -print sin(deg2rad(60)); // 0.866025403 ... -print sin(60); // -0.304810621 ... +echo sin(deg2rad(60)); // 0.866025403 ... +echo sin(60); // -0.304810621 ... ?> ]]> Index: phpdoc-it/reference/math/functions/sqrt.xml diff -u phpdoc-it/reference/math/functions/sqrt.xml:1.2 phpdoc-it/reference/math/functions/sqrt.xml:1.3 --- phpdoc-it/reference/math/functions/sqrt.xml:1.2 Wed Apr 17 03:07:22 2002 +++ phpdoc-it/reference/math/functions/sqrt.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'sqrt' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.sqrt"> <refnamediv> @@ -16,6 +16,19 @@ </methodsynopsis> <para> Restituisce la radice quadrata di <parameter>arg</parameter>. + </para> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +// La precisione dipende dalle impostazioni delle direttive sulla precisione +echo sqrt(9); // 3 +echo sqrt(10); // 3.16227766 ... +?> +]]> + </programlisting> + </informalexample> </para> <para> Vedere anche <function>pow</function>. Index: phpdoc-it/reference/math/functions/srand.xml diff -u phpdoc-it/reference/math/functions/srand.xml:1.2 phpdoc-it/reference/math/functions/srand.xml:1.3 --- phpdoc-it/reference/math/functions/srand.xml:1.2 Wed Apr 17 03:07:22 2002 +++ phpdoc-it/reference/math/functions/srand.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?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 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.2 --> <refentry id="function.srand"> <refnamediv> @@ -12,14 +12,17 @@ <title>Descrizione</title> <methodsynopsis> <type>void</type><methodname>srand</methodname> - <methodparam><type>int</type><parameter>seme</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>seme</parameter></methodparam> </methodsynopsis> <para> - Inizializza il generatore di num casuali con - <parameter>seme</parameter>. + Inizializza il generatore di numeri casuali con + <parameter>seme</parameter>. A partire dalla versione 4.2.0 di PHP + il parametro <parameter>seme</parameter> è opzionale, e per default + viene impostato ad un valore casuale. <informalexample> <programlisting> <![CDATA[ +<?php // inizializza usando i microsecondi function crea_seme() { list($usec, $sec) = explode(' ', microtime()); @@ -27,15 +30,17 @@ } srand((double)microtime()*1000000); $valorecasuale = rand(); +?> ]]> </programlisting> </informalexample> </para> + + ¬e.randomseed; + <simpara> Vedere anche <function>rand</function>, - <function>getrandmax</function>, <function>mt_rand</function>, - <function>mt_srand</function> e - <function>mt_getrandmax</function>. + <function>getrandmax</function> e <function>mt_srand</function>. </simpara> </refsect1> </refentry> Index: phpdoc-it/reference/math/functions/tan.xml diff -u phpdoc-it/reference/math/functions/tan.xml:1.2 phpdoc-it/reference/math/functions/tan.xml:1.3 --- phpdoc-it/reference/math/functions/tan.xml:1.2 Wed Apr 17 03:07:22 2002 +++ phpdoc-it/reference/math/functions/tan.xml Fri Jan 16 15:54:32 2004 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/math.xml, last change in rev 1.1 --> <!-- last change to 'tan' in en/ tree in rev 1.57 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: ready --> <!-- OLD-Revision: 1.78/EN.1.57 --> <refentry id="function.tan"> <refnamediv> @@ -15,10 +15,26 @@ <methodparam><type>float</type><parameter>arg</parameter></methodparam> </methodsynopsis> <para> - Restituisce la tangente di arg in radianti. + La funzione <function>tan</function> restituisce la tangente del parametro <parameter>arg</parameter>. + Il parametro <parameter>arg</parameter> deve essere espresso in radianti. </para> <para> - Vedere anche <function>sin</function> e <function>cos</function>. + <example> + <title>Esempio per <function>tan</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo tan(M_PI_2); // 1 + +?> +]]> + </programlisting> + </example> + </para> + <para> + Vedere anche <function>atan</function>, <function>sin</function>, + <function>cos</function> e <function>deg2rad</function>. </para> </refsect1> </refentry>