Trait malachite_base::num::arithmetic::traits::LegendreSymbol
source · [−]pub trait LegendreSymbol<RHS = Self> {
fn legendre_symbol(self, other: RHS) -> i8;
}
Expand description
Calculates the Legendre symbol of two numbers. Typically the implementations will be identical
to those of JacobiSymbol
.
Required Methods
fn legendre_symbol(self, other: RHS) -> i8
Implementations on Foreign Types
sourceimpl LegendreSymbol<u8> for u8
impl LegendreSymbol<u8> for u8
sourcefn legendre_symbol(self, n: u8) -> i8
fn legendre_symbol(self, n: u8) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<i8> for i8
impl LegendreSymbol<i8> for i8
sourcefn legendre_symbol(self, n: i8) -> i8
fn legendre_symbol(self, n: i8) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<u16> for u16
impl LegendreSymbol<u16> for u16
sourcefn legendre_symbol(self, n: u16) -> i8
fn legendre_symbol(self, n: u16) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<i16> for i16
impl LegendreSymbol<i16> for i16
sourcefn legendre_symbol(self, n: i16) -> i8
fn legendre_symbol(self, n: i16) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<u32> for u32
impl LegendreSymbol<u32> for u32
sourcefn legendre_symbol(self, n: u32) -> i8
fn legendre_symbol(self, n: u32) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<i32> for i32
impl LegendreSymbol<i32> for i32
sourcefn legendre_symbol(self, n: i32) -> i8
fn legendre_symbol(self, n: i32) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<u64> for u64
impl LegendreSymbol<u64> for u64
sourcefn legendre_symbol(self, n: u64) -> i8
fn legendre_symbol(self, n: u64) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<i64> for i64
impl LegendreSymbol<i64> for i64
sourcefn legendre_symbol(self, n: i64) -> i8
fn legendre_symbol(self, n: i64) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<u128> for u128
impl LegendreSymbol<u128> for u128
sourcefn legendre_symbol(self, n: u128) -> i8
fn legendre_symbol(self, n: u128) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<i128> for i128
impl LegendreSymbol<i128> for i128
sourcefn legendre_symbol(self, n: i128) -> i8
fn legendre_symbol(self, n: i128) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<usize> for usize
impl LegendreSymbol<usize> for usize
sourcefn legendre_symbol(self, n: usize) -> i8
fn legendre_symbol(self, n: usize) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.
sourceimpl LegendreSymbol<isize> for isize
impl LegendreSymbol<isize> for isize
sourcefn legendre_symbol(self, n: isize) -> i8
fn legendre_symbol(self, n: isize) -> i8
Computes the Legendre symbol of two numbers.
This implementation is identical to that of JacobiSymbol
, since there is no
computational benefit to requiring that the denominator be prime.
$$ 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.