Click or drag to resize
gmp_libmpn_scan1 Method
Scan s1p from bit position bit for the next set bit.

Namespace:  Math.Gmp.Native
Assembly:  Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static mp_bitcnt_t mpn_scan1(
	mp_ptr s1p,
	mp_bitcnt_t bit
)

Parameters

s1p
Type: Math.Gmp.Nativemp_ptr
The operand integer.
bit
Type: Math.Gmp.Nativemp_bitcnt_t
The index of the starting bit.

Return Value

Type: mp_bitcnt_t
The index of the next set bit.
Remarks

It is required that there be a set bit within the area at s1p at or beyond bit position bit, so that the function has something to return.

Examples
// Create multi-precision operand.
mp_ptr s1p = new mp_ptr(new uint[] { 0x0000001, 0x00000001 });

// Assert result of operation.
Assert.IsTrue(gmp_lib.mpn_scan1(s1p, 1) == 32);

// Release unmanaged memory.
gmp_lib.free(s1p);
See Also