(PHP 4 >= 4.0.4, PHP 5)
gmp_neg — 符号を反転する
ある数の符号を反転したものを返します。
It can be either a GMP number resource, or a numeric string given that it is possible to convert the latter to a number.
-a を GMP 数で返します。
例1 gmp_neg() の例
<?php
$neg1 = gmp_neg("1");
echo gmp_strval($neg1) . "\n";
$neg2 = gmp_neg("-1");
echo gmp_strval($neg2) . "\n";
?>
上の例の出力は以下となります。
-1 1