gmp_lib.mpn_mod_1 Method

GMP Native Interface for .NET

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
)
Public Shared Function mpn_mod_1 ( 
	s1p As mp_ptr,
	s1n As mp_size_t,
	s2limb As mp_limb_t
) As mp_limb_t
public:
static mp_limb_t mpn_mod_1(
	mp_ptr^ s1p, 
	mp_size_t s1n, 
	mp_limb_t s2limb
)
static member mpn_mod_1 : 
        s1p : mp_ptr * 
        s1n : mp_size_t * 
        s2limb : mp_limb_t -> mp_limb_t 

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);
' Create multi-precision operand.
Dim s1p As New mp_ptr(New UInteger() { &HfffffffeUI, &Hffff})

' 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)

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also