pub struct MersenneInt<const P: u8, const K: umax>(_);
Expand description

An unsigned integer modulo (pseudo) Mersenne primes 2^P - K, it supports P up to 127 and K < 2^(P-1)

IMPORTANT NOTE: this class assumes that 2^P-K is a prime. During compliation, we don’t do full check of the primality of 2^P-K. If it’s not a prime, then the modular division and inverse will panic.

Implementations

Create a new MersenneInt instance from a normal integer (by modulo 2^P-K)

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Converts to this type from the input type.

Converts to this type from the input type.

The result after applying the operator.

Returns the multiplicative inverse of self. Read more

The underlying representation type of the integer

Return the modulus of the ring

Return the normalized residue of this integer in the ring

Convert an normal integer into the same ring. Read more

Calculate the value of self + self

Calculate the value of self * self

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The result after applying the operator.

Returns self to the power rhs. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.