GMP Native Interface for .NET
gmp_libmpz_congruent_ui_p Method |
Return non-zero if n is congruent to c modulo d.
Namespace: Math.Gmp.Native
Assembly: Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)

public static int mpz_congruent_ui_p( mpz_t n, uint c, uint d )
Public Shared Function mpz_congruent_ui_p ( n As mpz_t, c As UInteger, d As UInteger ) As Integer
public: static int mpz_congruent_ui_p( mpz_t^ n, unsigned int c, unsigned int d )
static member mpz_congruent_ui_p : n : mpz_t * c : uint32 * d : uint32 -> int
Parameters
- n
- Type: Math.Gmp.Nativempz_t
An operand integer. - c
- Type: SystemUInt32
The remainder of the division by d. - d
- Type: SystemUInt32
The divisor operand integer.
Return Value
Type: Int32Non-zero if n is congruent to c modulo d.

n is congruent to c mod d if there exists an integer q satisfying n = c + q * d. Unlike the other division functions, d = 0 is accepted and following the rule it can be seen that n and c are considered congruent mod 0 only when exactly equal.

// Create, initialize, and set the value of n to 10000. mpz_t n = new mpz_t(); gmp_lib.mpz_init_set_ui(n, 10000U); // Assert that n is congruent to 1 mod 3. Assert.IsTrue(gmp_lib.mpz_congruent_ui_p(n, 1U, 3U) > 0); // Release unmanaged memory allocated for n. gmp_lib.mpz_clear(n);
' Create, initialize, and set the value of n to 10000. Dim n As New mpz_t() gmp_lib.mpz_init_set_ui(n, 10000UI) ' Assert that n is congruent to 1 mod 3. Assert.IsTrue(gmp_lib.mpz_congruent_ui_p(n, 1UI, 3UI) > 0) ' Release unmanaged memory allocated for n. gmp_lib.mpz_clear(n)
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.
