IntTryJacobi
Description
Compute the Jacobi symbol (a/n).
Parameters
| Name | Direction | Description |
|---|---|---|
a |
in | Numerator |
n |
in | Odd positive modulus |
error |
out | Optional pointer set to true on failure and false on success |
Usage example (from documentation)
int symbol = IntJacobi(&a, &n);Returns
-1, 0, or 1, or 0 on failure.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:1429:
}
bool IntTryJacobi(int *out, Int *a, Int *n) {
ValidateInt(a);
ValidateInt(n);- In
Int.c:1483:
int IntJacobiWithError(Int *a, Int *n, bool *error) {
int out = 0;
bool ok = IntTryJacobi(&out, a, n);
if (error) {- In
Int.c:1807:
{
int jacobi = 0;
if (!IntTryJacobi(&jacobi, &a, modulus) || jacobi != 1) {
IntDeinit(&a);
return false;- In
Int.c:1844:
int jacobi = 0;
if (!IntTryJacobi(&jacobi, &z, modulus)) {
IntDeinit(&q);
IntDeinit(&z);- In
Int.Math.c:929:
int symbol = 99;
bool error = false;
bool result = !IntTryJacobi(&symbol, &a, &n);
result = result && (IntJacobi(&a, &n, &error) == 0);
Last updated on