编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « 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 db++ 函数 get an id number unique to a relationphp eio 函数 returns number of finished but unhandled requestsphp fdf 函数 gets version number for fdf api or filephp 网络 函数 get protocol number associated with protocol namephp gmp 函数 clear bitphp gmp 函数 create gmp numberphp gmp 函数 convert gmp number to integerphp gmp 函数 inverse by modulophp 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 firebird/interbase 函数 return the number of parameters in a prepared queryphp imap 函数 this function returns the uid for the given message sequence number
关注编程学问公众号
编程学问网 湘ICP备20001732号