Date: 12/06/00
- Next message: Damien Seguy: "[PHP-DOC] cvs: phpdoc /fr/functions gmp.xml"
- Previous message: Stanislav Malyshev: "[PHP-DOC] cvs: phpdoc / global.ent"
- Next in thread: Egon Schmid: "[PHP-DOC] cvs: phpdoc /en/functions gmp.xml"
- Maybe reply: Egon Schmid: "[PHP-DOC] cvs: phpdoc /en/functions gmp.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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">
+<?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">
- Next message: Damien Seguy: "[PHP-DOC] cvs: phpdoc /fr/functions gmp.xml"
- Previous message: Stanislav Malyshev: "[PHP-DOC] cvs: phpdoc / global.ent"
- Next in thread: Egon Schmid: "[PHP-DOC] cvs: phpdoc /en/functions gmp.xml"
- Maybe reply: Egon Schmid: "[PHP-DOC] cvs: phpdoc /en/functions gmp.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

