| 17 | inline modint<MOD> operator - () const { return modint<MOD>(this->value ? MOD - this->value : 0); } |
| 18 | modint<MOD> pow(uint64_t k) const { modint<MOD> x = *this, y = 1; for (; k; k >>= 1) { if (k & 1) y *= x; x *= x; } return y; } |
| 19 | modint<MOD> inv() const { return pow(MOD - 2); } // MOD must be a prime |
| 20 | inline modint<MOD> operator / (modint<MOD> other) const { return *this * other.inv(); } |
| 21 | inline modint<MOD> operator /= (modint<MOD> other) { return *this *= other.inv(); } |
| 22 | inline bool operator == (modint<MOD> other) const { return value == other.value; } |
no test coverage detected