Click or drag to resize
gmp_libmpn_mod_1 Method
Divide {s1p, s1n} by s2limb, and return the remainder.

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_limb_t mpn_mod_1(
	mp_ptr s1p,
	mp_size_t s1n,
	mp_limb_t s2limb
)

Parameters

s1p
Type: Math.Gmp.Nativemp_ptr
The first operand integer.
s1n
Type: Math.Gmp.Nativemp_size_t
The number of limbs of s1p.
s2limb
Type: Math.Gmp.Nativemp_limb_t
The second operand integer.

Return Value

Type: mp_limb_t
The remainder.
Remarks

s1n can be zero.

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

// Assert s1p mod 3 is 2.
Assert.IsTrue(gmp_lib.mpn_mod_1(s1p, s1p.Size, 3) == 2);

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