gmp_neg

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

gmp_negNegazione di un numero

Descrizione

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

Restituisce il valore negativo di un numero.

Elenco dei parametri

num

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

Valori restituiti

Restituisce -num, come numero GMP.

Esempi

Example #1 Esempio di gmp_neg()

<?php
$neg1
= gmp_neg("1");
echo
gmp_strval($neg1) . "\n";
$neg2 = gmp_neg("-1");
echo
gmp_strval($neg2) . "\n";
?>

Il precedente esempio visualizzerà:

-1
1

add a note

User Contributed Notes

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