Javatpoint Logo
Javatpoint Logo

PHP GMP gmp_clrbit() Function

PHP has a built-in function called GMP gmp_clrbit() that clears a bit of a GMP number (GNU Multiple Precision). The gmp_clrbit() function turns off the bit in a GMP number that is at a certain index. The least important bit of the index is zero, so the index starts at zero.

Syntax

The following syntax shows a clear bit function using GMP numbers.

Parameters

The function requires two variables, $numbers and $index_number. Here's what they are:

  • $numbers: It can be a GMP number resource in PHP 5.5. It works on also a GMP objects in PHP 5.6 and later. Numeric strings can also be carried to the function as long as they can be turned into numbers.
  • $index number: The number of the bit value that needs to be clean or turned off.

The indexing starts at 0, and index 0 is the bit with the least importance.

Return Values

This function displays a GMP number (in PHP 5.5 and earlier) or a GMP object (in PHP 5.6 and later). the input value made the bit at the specified index is set to 0.

Examples

The following examples show the "clear bit" (clrbit) function using the GMP parameters.

Example1: The following example shows the basic clear bit operation using the GMP function.

Output:

The following output shows the clear bit values using the GMP function.

PHP GMP gmp_clrbit() Function

Example2: The following example shows the basic clear bit operation using the GMP function.

Output:

The following output shows the clear bit values using the GMP function.

PHP GMP gmp_clrbit() Function

Example3: The following example shows the basic clear bit function with a negative value. here, we can use negative value and the "gmp_abs()" function.

Output:

The following output shows the clear bit values using the GMP function.

PHP GMP gmp_clrbit() Function

Conclusion

The "gmp_clrbit ()" function uses to clear or clean the given index value from the input parameter. It is a numerical or clear value operation with GMP parameters or values.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA