Click or drag to resize
gmp_libmpz_si_kronecker Method
Calculate the Jacobi symbol (a/b) with the Kronecker extension (a/2) = (2/a) when a odd, or (a/2) = 0 when a even.

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 int mpz_si_kronecker(
	int a,
	mpz_t b
)

Parameters

a
Type: SystemInt32
The first operand integer.
b
Type: Math.Gmp.Nativempz_t
The second operand integer.

Return Value

Type: Int32
The Jacobi symbol (a/b) with the Kronecker extension (a/2) = (2/a) when a odd, or (a/2) = 0 when a even.
Remarks

When b is odd the Jacobi symbol and Kronecker symbol are identical, so mpz_kronecker_ui, etc. can be used for mixed precision Jacobi symbols too.

Examples
// Create, initialize, and set the value of b to 4.
mpz_t b = new mpz_t();
gmp_lib.mpz_init_set_ui(b, 4U);

// Assert that the Kronecker symbol of (15/b) is 1.
Assert.IsTrue(gmp_lib.mpz_si_kronecker(15, b) == 1);

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