gmp_testbit

PHP 5 >= 5.3.0, PHP 7, PHP 8
gmp_testbit - Tests if a bit is set
Manual
Code Examples

gmp_testbit( GMP|int|string$num, int$index ): bool

Tests if the specified bit is set.

Parameters

num

A GMP object, an int or a numeric string.

index

The bit to test

Return Values

Returns true if the bit is set in num, otherwise false.

Exceptions and Errors

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

Related Functions

Example of gmp_testbit

Show all examples for gmp_testbit

PHP Version: