Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

gmp_clrbit

Description

The gmp_clrbit of GMP for PHP clears a bit.

Syntax

gmp_clrbit(
    GMP $num,
    int $index
): void

Parameters

num

A GMP object.

index

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

Return

No value is returned.

Examples

1 · num index · 0

<?

$num = 0b111;
$index = 0;

$num = gmp_init($num);

gmp_clrbit($num, $index);

$base = 2;

$gmp_strval = gmp_strval($num, $base);

echo $gmp_strval;

?>
110

2 · num index · 1

<?

$num = 0b111;
$index = 1;

$num = gmp_init($num);

gmp_clrbit($num, $index);

$base = 2;

$gmp_strval = gmp_strval($num, $base);

echo $gmp_strval;

?>
101

3 · num index · 2

<?

$num = 0b111;
$index = 2;

$num = gmp_init($num);

gmp_clrbit($num, $index);

$base = 2;

$gmp_strval = gmp_strval($num, $base);

echo $gmp_strval;

?>
11
HomeMenu