gmp_neg

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

gmp_negNegate number

Opis

gmp_neg ( GMP $a ) : GMP

Returns the negative value of a number.

Parametry

a

Może być zarówno zasobem numeru GMP w PHP 5.5 i wcześniejszych, obiektem klasy GMP w PHP 5.6 i późniejszych lub numerycznym łańcuchem znaków, który można skonwertować z liter do liczb.

Zwracane wartości

Returns -a, as a GMP number.

Przykłady

Przykład #1 gmp_neg() example

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

Powyższy przykład wyświetli:

-1
1

add a note add a note

User Contributed Notes

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