IntJacobi
IntJacobi
Description
Compute the Jacobi symbol (a/n).
Aborts when
n is zero or even.
Parameters
| Name | Direction | Description |
|---|---|---|
a |
in | Numerator |
n |
in | Odd positive modulus |
Usage example (from documentation)
int symbol = IntJacobi(&a, &n);Returns
-1, 0, or 1.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:1323:
}
int IntJacobi(Int *a, Int *n) {
ValidateInt(a);
ValidateInt(n);- In
Int.c:1669:
return false;
}
if (IntJacobi(&a, modulus) != 1) {
IntDeinit(&a);
return false;- In
Int.c:1702:
}
while (IntJacobi(&z, modulus) != -1) {
MISRA_PRIV_IntAddU64(&z, &z, 1);
}- In
Int.Math.c:550:
bool test_int_jacobi(void) {
WriteFmt("Testing IntJacobi\n");
Int a = IntFrom(5);- In
Int.Math.c:557:
Int n = IntFrom(21);
bool result = IntJacobi(&a, &p) == -1;
result = result && (IntJacobi(&b, &n) == 0);- In
Int.Math.c:558:
bool result = IntJacobi(&a, &p) == -1;
result = result && (IntJacobi(&b, &n) == 0);
IntDeinit(&a);- In
Int.Math.c:895:
bool test_int_jacobi_even_denominator(void) {
WriteFmt("Testing IntJacobi even denominator handling\n");
Int a = IntFrom(3);- In
Int.Math.c:900:
Int n = IntFrom(8);
(void)IntJacobi(&a, &n);
return false;
}
Last updated on