array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.gmp-sub.php', 1 => 'gmp_sub', ), 'up' => array ( 0 => 'ref.gmp.php', 1 => 'Funções GMP', ), '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' => 'pt_BR', '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 — Subtrai números
Subtrai num2
de num1
e retorna o resultado.
Um objeto GMP.
Exemplo #1 Exemplo da gmp_sub()
<?php
$sub = gmp_sub("281474976710656", "4294967296"); // 2^48 - 2^32
echo gmp_strval($sub) . "\n";
?>
O exemplo acima produzirá:
281470681743360