|
gmp_setbitSet bit Description
void gmp_setbit(GMP
$num , int $index , bool $value = true )
Sets bit Parameters
Return ValuesA GMP object. Examples
Example #1 gmp_setbit example - 0 index
The above example will output: 2 -> 0b10 3 -> 0b11 Example #2 gmp_setbit example - 1 index
The above example will output: 253 -> 0b11111101 255 -> 0b11111111 Example #3 gmp_setbit example - clearing a bit
The above example will output: 255 -> 0b11111111 254 -> 0b11111110 Notes
See Also
|