Computer >> Computer tutorials >  >> Programming >> PHP

gmp_fact() function in PHP


The gmp_fact() function computes the factorial of a GMP number.

Syntax

gmp_fact (val)

Parameters

  • val: The GMP number for which you want the factorial.

Return

The gmp_fact() function returns the factorial.

Example

The following is an example:

<?php
   $res = gmp_fact(7);
   echo gmp_strval($res);
?>

Output

The following is the output:

5040