gmp_add()
(PHP 4 >= 4.0.4, PHP 5, PHP 7)
Add numbers
说明
gmp_add(GMP$a, GMP$b): GMP
Add two numbers.
参数
- $a
The first summand(augent).
可以是一个 GMP数据resouce,或一个可以转换为数值的字符串。
- $b
The second summand(addend).
可以是一个 GMP数据resouce,或一个可以转换为数值的字符串。
返回值
A GMP number representing the sum of the arguments.
范例
gmp_add() example
<?php $sum = gmp_add("123456789012345", "76543210987655"); echo gmp_strval($sum) . "\n"; ?>
以上例程会输出:
200000000000000