DModInt

自動mod取り構造体(実行時mod指定)

Constructors

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

Members

Functions

opBinary
auto opBinary(DModInt r)

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

opOpAssign
auto opOpAssign(DModInt 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
DModInt inv(DModInt 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.

Static variables

MD
uint MD;
Undocumented in source.

Variables

v
uint v;
Undocumented in source.

Examples

alias Mint1 = DModInt!"mod1";
alias Mint2 = DModInt!"mod2";
Mint1.MD = 7;
Mint2.MD = 9;
assert((Mint1(5)+Mint1(5)).v == 3); // (5+5) % 7
assert((Mint2(5)+Mint2(5)).v == 1); // (5+5) % 9    

Meta