gmp_fact

(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)

gmp_factFattoriale

Descrizione

gmp_fact(GMP|int|string $num): GMP

Calcola il fattoriale (num!) di num.

Elenco dei parametri

num

Il numero di cui calcolare il fattoriale.

Può essere o una resource numero GMP, oppure una stringa numerica dal momento che è possibile convertire quest'ultimo in un numero.

Valori restituiti

Una resource numero GMP.

Esempi

Example #1 Esempio di gmp_fact()

<?php
$fact1
= gmp_fact(5); // 5 * 4 * 3 * 2 * 1
echo gmp_strval($fact1) . "\n";

$fact2 = gmp_fact(50); // 50 * 49 * 48, ... ecc
echo gmp_strval($fact2) . "\n";
?>

Il precedente esempio visualizzerà:

120
30414093201713378043612608166064768844377641568960512000000000000

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top