Forum und email

gmp_testbit

(No version information available, might be only in CVS)

gmp_testbit — Tests if a bit is set

Descrição

bool gmp_testbit ( resource $a , int $index )

Tests if the specified bit is set.

Parâmetros

a

Ele pode ser qualquer número GMP resource, ou uma string numérica que é possível convertê-la para um número.

index

The bit to test

Valor Retornado

Retorna TRUE em caso de sucesso ou FALSE em falhas.

Erros

E_WARNING is issued when index is less than zero.

Exemplos

Example#1 gmp_testbit() example

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

O exemplo acima irá imprimir:

bool(false)
bool(true)

Veja também