Click or drag to resize
gmp_libmpz_cdiv_ui Method
Return the remainder | r | where r = n - q * d, and where q = ceiling(n / d).

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 uint mpz_cdiv_ui(
	mpz_t n,
	uint d
)

Parameters

n
Type: Math.Gmp.Nativempz_t
The numerator integer.
d
Type: SystemUInt32
The denominator integer.

Return Value

Type: UInt32
The remainder | r | where r = n - q * d, and where q = ceiling(n / d).
Examples
// Create, initialize, and set the value of n to 10000.
mpz_t n = new mpz_t();
gmp_lib.mpz_init_set_si(n, 10000);

// Assert that returned value is |n - 3 * ceiling(n / 3)|.
Assert.IsTrue(gmp_lib.mpz_cdiv_ui(n, 3U) == 2U);

// Release unmanaged memory allocated for n.
gmp_lib.mpz_clear(n);
See Also