gmp_libmpz_jacobi Method |
Namespace: Math.Gmp.Native
public static int mpz_jacobi( mpz_t a, mpz_t b )
Public Shared Function mpz_jacobi ( a As mpz_t, b As mpz_t ) As Integer
public: static int mpz_jacobi( mpz_t^ a, mpz_t^ b )
static member mpz_jacobi : a : mpz_t * b : mpz_t -> int
This is defined only for b odd.
// Create, initialize, and set the value of a to 11. mpz_t a = new mpz_t(); gmp_lib.mpz_init_set_ui(a, 11U); // Create, initialize, and set the value of b to 9. mpz_t b = new mpz_t(); gmp_lib.mpz_init_set_ui(b, 9U); // Assert that the Jacobi symbol of (a/b) is 1. Assert.IsTrue(gmp_lib.mpz_jacobi(a, b) == 1); // Release unmanaged memory allocated for a and b. gmp_lib.mpz_clears(a, b, null);
' Create, initialize, and set the value of a to 11. Dim a As New mpz_t() gmp_lib.mpz_init_set_ui(a, 11UI) ' Create, initialize, and set the value of b to 9. Dim b As New mpz_t() gmp_lib.mpz_init_set_ui(b, 9UI) ' Assert that the Jacobi symbol of (a/b) is 1. Assert.IsTrue(gmp_lib.mpz_jacobi(a, b) = 1) ' Release unmanaged memory allocated for a and b. gmp_lib.mpz_clears(a, b, Nothing)
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.