gmp_setbit

PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
gmp_setbit - Set bit
Manual
Code Examples

gmp_setbit( GMP$num, int$index, [bool$value = true] ): void

Sets bit index in num.

Parameters

num

The value to modify.

A GMP object, an int or a numeric string.

index

The index of the bit to set. Index 0 represents the least significant bit.

value

True to set the bit (set it to 1/on); false to clear the bit (set it to 0/off).

Return Values

A GMP object.

Notes

Note:

Unlike most of the other GMP functions, gmp_setbit must be called with a GMP object that already exists (using gmp_init for example). One will not be automatically created.

Related Functions

Example of gmp_setbit

Show all examples for gmp_setbit

PHP Version: