Function quadratic::jacobi [] [src]

pub fn jacobi(a: isize, n: isize) -> Option<i8>

Returns the value of the Jacobi symbol for (a \ n) Where a is an integer and n is an odd positive integer

If the intergers passed in do not match these assumptions, the return value will be None. Otherwise the algorithm can be assumed to always succeed.

Example

// compute the Jacobi symbol of (2 \ 5)
let symb = quadratic::jacobi(2, 5);
assert_eq!(Some(-1), symb);