int with mod, mod must be prime
We can handle it as same as int(but divide is slow)
return 1/x
1 alias Mint = ModInt!(107); 2 assert((Mint(100) + Mint(10)).v == 3); 3 assert(( Mint(10) * Mint(12)).v == 13); 4 assert(( Mint(1) / Mint(2)).v == 108/2); 5 assert((Mint(2) ^^ 7).v == 21);
See Implementation
int with mod, mod must be prime