pub trait JacobiSymbol<RHS = Self> {
// Required method
fn jacobi_symbol(self, other: RHS) -> i8;
}
Expand description
Calculates the Jacobi symbol of two numbers.
Required Methods§
fn jacobi_symbol(self, other: RHS) -> i8
Implementations on Foreign Types§
Source§impl JacobiSymbol for i8
impl JacobiSymbol for i8
Source§fn jacobi_symbol(self, n: i8) -> i8
fn jacobi_symbol(self, n: i8) -> i8
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is
max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even.
§Examples
See here.
Source§impl JacobiSymbol for i16
impl JacobiSymbol for i16
Source§fn jacobi_symbol(self, n: i16) -> i8
fn jacobi_symbol(self, n: i16) -> i8
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is
max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even.
§Examples
See here.
Source§impl JacobiSymbol for i32
impl JacobiSymbol for i32
Source§fn jacobi_symbol(self, n: i32) -> i8
fn jacobi_symbol(self, n: i32) -> i8
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is
max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even.
§Examples
See here.
Source§impl JacobiSymbol for i64
impl JacobiSymbol for i64
Source§fn jacobi_symbol(self, n: i64) -> i8
fn jacobi_symbol(self, n: i64) -> i8
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is
max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even.
§Examples
See here.
Source§impl JacobiSymbol for i128
impl JacobiSymbol for i128
Source§fn jacobi_symbol(self, n: i128) -> i8
fn jacobi_symbol(self, n: i128) -> i8
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is
max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even.
§Examples
See here.
Source§impl JacobiSymbol for isize
impl JacobiSymbol for isize
Source§fn jacobi_symbol(self, n: isize) -> i8
fn jacobi_symbol(self, n: isize) -> i8
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is
max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even.
§Examples
See here.
Source§impl JacobiSymbol for u8
Computes the Jacobi symbol of two numbers.
impl JacobiSymbol for u8
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even or negative.
§Examples
See here.
fn jacobi_symbol(self, n: u8) -> i8
Source§impl JacobiSymbol for u16
Computes the Jacobi symbol of two numbers.
impl JacobiSymbol for u16
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even or negative.
§Examples
See here.
fn jacobi_symbol(self, n: u16) -> i8
Source§impl JacobiSymbol for u32
Computes the Jacobi symbol of two numbers.
impl JacobiSymbol for u32
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even or negative.
§Examples
See here.
fn jacobi_symbol(self, n: u32) -> i8
Source§impl JacobiSymbol for u64
Computes the Jacobi symbol of two numbers.
impl JacobiSymbol for u64
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even or negative.
§Examples
See here.
fn jacobi_symbol(self, n: u64) -> i8
Source§impl JacobiSymbol for u128
impl JacobiSymbol for u128
Source§fn jacobi_symbol(self, n: u128) -> i8
fn jacobi_symbol(self, n: u128) -> i8
Source§impl JacobiSymbol for usize
Computes the Jacobi symbol of two numbers.
impl JacobiSymbol for usize
Computes the Jacobi symbol of two numbers.
$$ f(x, y) = \left ( \frac{x}{y} \right ). $$
§Worst-case complexity
$T(n) = O(n^2)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits())
.
§Panics
Panics if n
is even or negative.
§Examples
See here.