dismiss Step into the future! Click here to switch to the beta php.net site
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

GMP Functions> <Predefined Constants
[edit] Last updated: Fri, 28 Jun 2013

view this page in

Examples

Example #1 Factorial function using GMP

<?php
function fact($x
{
    
$return 1;
    for (
$i=2$i <= $x$i++) {
        
$return gmp_mul($return$i);
    }
    return 
$return;
}

echo 
gmp_strval(fact(1000)) . "\n";
?>

This will calculate factorial of 1000 (pretty big number) very fast.



add a note add a note User Contributed Notes Examples - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites