编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « gmp_mul
  • gmp_nextprime »
  • PHP Manual
  • GMP 函数
  • Negate number

gmp_neg

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

gmp_neg — Negate number

说明

gmp_neg ( GMP $a ) : GMP

Returns the negative value of a number.

参数

a

可以是一个 GMP 数据 resouce,或一个可以转换为数值的字符串。

返回值

Returns -a, as a GMP number.

范例

Example #1 gmp_neg() example

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

以上例程会输出:

-1
1

相关文章
php apcu 函数 increase a stored numberphp eio 函数 returns number of not yet handled requestsphp eio 函数 set maximum number of requests processed in a pollphp 网络 函数 get protocol name associated with protocol numberphp gmp 函数 compare numbersphp gmp 函数 create gmp numberphp gmp 函数 convert gmp number to integerphp gmp 函数 jacobi symbolphp gmp 函数 negate numberphp gmp 函数 find next prime numberphp gmp 函数 raise number into powerphp gmp 函数 raise number into power with modulophp gmp 函数 check if number is probably prime php gmp 函数 random numberphp gmp 函数 random numberphp gmp 函数 random numberphp gmp 函数 sign of numberphp gmp 函数 convert gmp number to stringphp statistic 函数 get the seed values of the random number generatorphp mnogosearch 函数 get mnogosearch error number
关注编程学问公众号
编程学问网 湘ICP备20001732号