Home > PHP > Function > GMP > gmp_scan1()

gmp_scan1()

gmp_scan1 - Scan for 1

Syntax

int gmp_scan1 (resource $a, int $start)

Arguments

  • a - The number to scan. It can be either a GMP number resource, or a numeric string given that it is possible to convert the latter to a number.
  • start - The starting bit.

Description

Scans a, starting with bit start, towards more significant bits, until the first set bit is found.

Version

PHP 4.0.4, 5

Return value

Returns the index of the found bit, as an integer. If no set bit is found, -1 is returned.