cvs: phpdoc /en/functions gmp.xml

From: Date: Wed, 06 Dec 2000 14:33:36 +0000
Subject: cvs: phpdoc /en/functions gmp.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969333160@lists.php.net to get a copy of this message
stas Wed Dec 6 06:33:36 2000 EDT Modified files: /phpdoc/en/functions gmp.xml Log: Add example Index: phpdoc/en/functions/gmp.xml diff -u phpdoc/en/functions/gmp.xml:1.1 phpdoc/en/functions/gmp.xml:1.2 --- phpdoc/en/functions/gmp.xml:1.1 Wed Dec 6 06:17:35 2000 +++ phpdoc/en/functions/gmp.xml Wed Dec 6 06:33:36 2000 @@ -33,6 +33,25 @@ every function that expects GMP number. See also <function>gmp_init</function> function. </para></note> + <para> + <example> + <title>Factorial function using GMP</title> + <programlisting role="php"> +&lt;?php +function fact($x) { + if($x <= 1) + return 1; + else + return gmp_mul($x,fact($x-1)); +} + +print gmp_strval(fact(1000))."\n"; +?> + </programlisting> + </example> + This will calculate factiorial of 1000 (pretty big number) + very fast. + </para> </partintro> <refentry id="function.gmp-init">

« previous php.doc (#969333160) next »