编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « 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 dbase 函数 gets the number of fields of a databasephp gmp 函数 add numbersphp gmp 函数 import from a binary stringphp gmp 函数 create gmp numberphp gmp 函数 convert gmp number to integerphp 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 gmp 函数 subtract numbersphp sqlite 函数 seek to the next row numberphp sqlsrv 函数 retrieves the number of fields columns on a statementphp svn 函数 returns the number of the youngest revision in the filesystemphp hyperwave api 函数 returns number of reasons
关注编程学问公众号
编程学问网 湘ICP备20001732号