gmp_libmpz_kronecker_si 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_kronecker_si(
mpz_t a,
int b
)
Public Shared Function mpz_kronecker_si (
a As mpz_t,
b As Integer
) As Integer
public:
static int mpz_kronecker_si(
mpz_t^ a,
int b
)
static member mpz_kronecker_si :
a : mpz_t *
b : int -> int
Parameters
- a
- Type: Math.Gmp.Nativempz_t
The first operand integer. - b
- Type: SystemInt32
The second operand integer.
Return Value
Type:
Int32The 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(mpz_t, UInt32), etc. can be used for mixed precision Jacobi symbols too.
Examples
mpz_t a = new mpz_t();
gmp_lib.mpz_init_set_ui(a, 15U);
Assert.IsTrue(gmp_lib.mpz_kronecker_si(a, 4) == 1);
gmp_lib.mpz_clear(a);
Dim a As New mpz_t()
gmp_lib.mpz_init_set_ui(a, 15UI)
Assert.IsTrue(gmp_lib.mpz_kronecker_si(a, 4) = 1)
gmp_lib.mpz_clear(a)
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