array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'function.gmp-testbit.php', 1 => 'gmp_testbit', ), 'up' => array ( 0 => 'ref.gmp.php', 1 => 'Funciones de GMP', ), 'prev' => array ( 0 => 'function.gmp-sub.php', 1 => 'gmp_sub', ), 'next' => array ( 0 => 'function.gmp-xor.php', 1 => 'gmp_xor', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'es', 'path' => 'reference/gmp/functions/gmp-testbit.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
gmp_testbit — Prueba si un bit es establecido
Devuelve true
si el bit se establece en el recurso $a
,
de otro modo devuelve false
.
Se emite un error de nivel E_WARNING
cuando
index
es menor que cero, y se
devuelve false
.
Ejemplo #1 Ejemplo degmp_testbit()
<?php
$n = gmp_init("1000000");
var_dump(gmp_testbit($n, 1));
gmp_setbit($n, 1);
var_dump(gmp_testbit($n, 1));
?>
El resultado del ejemplo sería:
bool(false) bool(true)