PHP GMP gmp_clrbit() FunctionPHP 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. SyntaxThe following syntax shows a clear bit function using GMP numbers. ParametersThe function requires two variables, $numbers and $index_number. Here's what they are:
The indexing starts at 0, and index 0 is the bit with the least importance. Return ValuesThis 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. ExamplesThe 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. 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. 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. ConclusionThe "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. Next TopicPHP GMP gmp_cmp() Function |