gmp_testbit

(PHP 5 >= 5.3.0, PHP 7)

gmp_testbitTests if a bit is set

说锟斤拷

gmp_testbit ( GMP $a , int $index ) : bool

Tests if the specified bit is set.

锟斤拷锟斤拷

a

锟斤拷锟斤拷锟斤拷一锟斤拷 GMP 锟斤拷锟斤拷 resouce锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷转锟斤拷为锟斤拷值锟斤拷锟街凤拷锟斤拷锟斤拷

index

The bit to test

锟斤拷锟斤拷值

Returns TRUE if the bit is set in resource $a, otherwise FALSE.

锟斤拷锟斤拷锟届常

An E_WARNING level error is issued when index is less than zero, and FALSE is returned.

锟斤拷锟斤拷

Example #1 gmp_testbit() example

<?php
$n 
gmp_init("1000000");
var_dump(gmp_testbit($n1));
gmp_setbit($n1);
var_dump(gmp_testbit($n1));
?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

bool(false)
bool(true)

锟轿硷拷