int with mod, mod can be setted in execute time. mod don't have to be prime.
整数型と同じように演算可能 割り算のみ遅い
xの逆元を求める
1 alias Mint1 = DModInt!"mod1"; 2 alias Mint2 = DModInt!"mod2"; 3 Mint1.MD = 7; 4 Mint2.MD = 9; 5 assert((Mint1(5)+Mint1(5)).v == 3); // (5+5) % 7 6 assert((Mint2(5)+Mint2(5)).v == 1); // (5+5) % 9
See Implementation
int with mod, mod can be setted in execute time. mod don't have to be prime.