Javatpoint Logo
Javatpoint Logo

PHP gmp_scan0() function

PHP language provides a multiple GMP function to handle and operate on numeric data. The GMP function gmp_scan0() shows the "scan to 0" bit and number. Here, we can find the position of the "0" value in the input base number. The number scans to 0 using index value or position towards the largest or most significant number.

Syntax

The syntax shows the GMP function to scan the "0" index number towards the largest significant GMP parameter.

Parameters

  • The function takes two variables: a first value for $base_value and a second integer value for $index_value. The gmp_scan0() function and its operational works depend on both variables.
  • The function supports the PHP 5.6 and above version with various input data. The GMP string data turns into the number.
    • $base_value: it is the GMP parameter of the integer data returns as the base value or output of the function.
    • $index_value: it is the integer parameter to scan 0 of the $base_value using the $index_value.

Return Value

This function shows the numerical output after scanning to the "0" of the given data.

Examples

The examples show the GMP function to scan the "0" bit using base and index values.

Example1: the given an example displays the position of the 0-bit value using essential parameters. Here we are using the same base value with different index values.

Output:

The output image shows the position of the 0-bit value of the input data.

PHP gmp_scan0() function

Example2: the given an example displays the position of the 0-bit value using essential parameters. Here we use different base values with the same index value.

Output:

The output image shows the position of the 0-bit value of the input data.

PHP gmp_scan0() function

Example3: the given an example displays the position of the 0-bit value using essential parameters. Here we use different base values with different index values.

Output:

The output image shows the position of the 0-bit value of the input data.

PHP gmp_scan0() function

Example4: the given an example displays the position of the 0-bit value using essential parameters. Here we use different integer values with the "0" index values.

Output:

The output image shows the position of the 0-bit value of the input data.

PHP gmp_scan0() function

Example5: the given an example displays the position of the 0-bit value using essential parameters. Here, we use the gmp_init() function to initialize the parameter and use it with the gmp_scan0() function.

Output:

The output image shows the position of the 0-bit value of the input data.

PHP gmp_scan0() function

Example6: the given an example displays the position of the 0-bit value using essential parameters. Here, we use the GMP parameters and function with the gmp_scan0() function.

Output:

The output image shows the position of the 0-bit value of the input data.

PHP gmp_scan0() function

Conclusion

The gmp_scan0() function displays the position of the "0" bit in the given number. This function helps to get output using a single line function. The complex coding part of the mathematical operation in the php programming language can be removed using the function.







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