ModInt

自動mod取り構造体

Constructors

this
this(int v)
Undocumented in source.
this
this(long v)
Undocumented in source.

Members

Functions

opBinary
auto opBinary(ModInt r)

整数型と同じように演算可能 割り算のみ遅い

opOpAssign
auto opOpAssign(ModInt r)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

inv
ModInt inv(ModInt x)

xの逆元を求める

make
auto make(uint x)
Undocumented in source. Be warned that the author may not have intended to support it.
normS
auto normS(uint x)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

v
uint v;
Undocumented in source.

Examples

alias Mint = ModInt!(107);
assert((Mint(100) + Mint(10)).v == 3);
assert(( Mint(10) * Mint(12)).v == 13);
assert((  Mint(1) /  Mint(2)).v == 108/2);

Meta