gmp_testbit
gmp_testbit
Tests if a bit is set
bool **gmp_testbit** $num int $index
Tests if the specified bit is set.
num``indexThe bit to test
Returns true if the bit is set in ,
otherwise false.
num
An level error is issued when
is less than zero, and false
is returned.
E_WARNING``index
Voorbeeld: example
<?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)
gmp_setbit``gmp_clrbit