array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.gmp-sub.php', 1 => 'gmp_sub', ), 'up' => array ( 0 => 'ref.gmp.php', 1 => 'GMP Functions', ), 'prev' => array ( 0 => 'function.gmp-strval.php', 1 => 'gmp_strval', ), 'next' => array ( 0 => 'function.gmp-testbit.php', 1 => 'gmp_testbit', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/gmp/functions/gmp-sub.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)
gmp_sub — Subtract numbers
Subtracts num2
from num1
and returns the result.
A GMP object.
Example #1 gmp_sub() example
<?php
$sub = gmp_sub("281474976710656", "4294967296"); // 2^48 - 2^32
echo gmp_strval($sub) . "\n";
?>
The above example will output:
281470681743360