Enum Modulo998244353

Source
pub enum Modulo998244353 {}

Trait Implementations§

Source§

impl MontgomeryReduction32 for Modulo998244353

Source§

const MOD: u32 = 998_244_353u32

m
Source§

const R: u32 = _

(-m)^{-1} mod n
Source§

const N1: u32 = _

n^1 mod m
Source§

const N2: u32 = _

n^2 mod m
Source§

const N3: u32 = _

n^3 mod m
Source§

fn reduce(x: u64) -> u32

n^{-1}x = (x + (xr mod n)m) / n

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<M> MIntBase for M

Source§

type Inner = u32

Source§

fn get_mod() -> <M as MIntBase>::Inner

Source§

fn mod_zero() -> <M as MIntBase>::Inner

Source§

fn mod_one() -> <M as MIntBase>::Inner

Source§

fn mod_add( x: <M as MIntBase>::Inner, y: <M as MIntBase>::Inner, ) -> <M as MIntBase>::Inner

Source§

fn mod_sub( x: <M as MIntBase>::Inner, y: <M as MIntBase>::Inner, ) -> <M as MIntBase>::Inner

Source§

fn mod_mul( x: <M as MIntBase>::Inner, y: <M as MIntBase>::Inner, ) -> <M as MIntBase>::Inner

Source§

fn mod_div( x: <M as MIntBase>::Inner, y: <M as MIntBase>::Inner, ) -> <M as MIntBase>::Inner

Source§

fn mod_neg(x: <M as MIntBase>::Inner) -> <M as MIntBase>::Inner

Source§

fn mod_inv(x: <M as MIntBase>::Inner) -> <M as MIntBase>::Inner

Source§

fn mod_inner(x: <M as MIntBase>::Inner) -> <M as MIntBase>::Inner

Source§

fn mod_pow(x: Self::Inner, y: usize) -> Self::Inner

Source§

impl<M> MIntConvert<i32> for M

Source§

fn from(x: i32) -> <M as MIntBase>::Inner

Source§

fn into(x: <M as MIntBase>::Inner) -> i32

Source§

fn mod_into() -> i32

Source§

impl<M> MIntConvert<i64> for M

Source§

fn from(x: i64) -> <M as MIntBase>::Inner

Source§

fn into(x: <M as MIntBase>::Inner) -> i64

Source§

fn mod_into() -> i64

Source§

impl<M> MIntConvert<isize> for M

Source§

impl<M> MIntConvert<u32> for M

Source§

fn from(x: u32) -> <M as MIntBase>::Inner

Source§

fn into(x: <M as MIntBase>::Inner) -> u32

Source§

fn mod_into() -> u32

Source§

impl<M> MIntConvert<u64> for M

Source§

fn from(x: u64) -> <M as MIntBase>::Inner

Source§

fn into(x: <M as MIntBase>::Inner) -> u64

Source§

fn mod_into() -> u64

Source§

impl<M> MIntConvert<usize> for M

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.