array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.gmp-testbit.php', 1 => 'gmp_testbit', ), 'up' => array ( 0 => 'ref.gmp.php', 1 => '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' => 'ja', '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 — ビットが設定されているかどうかを調べる
例1 gmp_testbit() の例
<?php
$n = gmp_init("1000000");
var_dump(gmp_testbit($n, 1));
gmp_setbit($n, 1);
var_dump(gmp_testbit($n, 1));
?>
上の例の出力は以下となります。
bool(false) bool(true)