gmp_scan1
Description
Syntax
gmp_scan1( GMP|int|string $num, int $start ): int
Parameters
num
The number to scan.
A GMP object, an int or a numeric string.
start
The starting bit.
Return
Returns the index of the found bit, as an int. If no set bit is found, -1 is returned.
Examples
1 · num · GMP
<? $num = 0b010; $start = 0; $num = gmp_init($num); $return = gmp_scan1($num, $start); echo $return; ?>
1
2 · num · int
<? $num = 0b010; $start = 0; $return = gmp_scan1($num, $start); echo $return; ?>
1
3 · num · string
<? $num = "0b010"; $start = 0; $return = gmp_scan1($num, $start); echo $return; ?>
1
4 · start
<? $num = "0b010"; $start = 2; $return = gmp_scan1($num, $start); echo $return; ?>
-1
Links
Related
GMP
- gmp_abs
- gmp_add
- gmp_and
- gmp_binomial
- gmp_clrbit
- gmp_cmp
- gmp_com
- gmp_div
- gmp_div_q
- gmp_div_qr
- gmp_div_r
- gmp_divexact
- gmp_export
- gmp_fact
- gmp_gcd
- gmp_gcdext
- gmp_hamdist
- gmp_import
- gmp_init
- gmp_intval
- gmp_invert
- gmp_jacobi
- gmp_kronecker
- gmp_lcm
- gmp_legendre
- gmp_mod
- gmp_mul
- gmp_neg
- gmp_nextprime
- gmp_or
- gmp_perfect_power
- gmp_perfect_square
- gmp_popcount
- gmp_pow
- gmp_powm
- gmp_prob_prime
- gmp_random_bits
- gmp_random_range
- gmp_random_seed
- gmp_root
- gmp_rootrem
- gmp_scan0
- gmp_setbit
- gmp_sign
- gmp_sqrt
- gmp_sqrtrem
- gmp_strval
- gmp_sub
- gmp_testbit
- gmp_xor