Update number/mll.cc
This commit is contained in:
parent
4a682bd607
commit
3c19859012
|
@ -6,8 +6,8 @@ template <ll mdl> struct MLL {
|
||||||
friend MLL operator*(const MLL& lhs, const MLL& rhs) { return mod(lhs.val * rhs.val, mdl); }
|
friend MLL operator*(const MLL& lhs, const MLL& rhs) { return mod(lhs.val * rhs.val, mdl); }
|
||||||
friend MLL operator/(const MLL& lhs, const MLL& rhs) { return mod(lhs.val * mod(inverse(rhs.val, mdl), mdl), mdl); }
|
friend MLL operator/(const MLL& lhs, const MLL& rhs) { return mod(lhs.val * mod(inverse(rhs.val, mdl), mdl), mdl); }
|
||||||
friend MLL operator%(const MLL& lhs, const MLL& rhs) { return mod(lhs.val - (lhs / rhs).val, mdl); }
|
friend MLL operator%(const MLL& lhs, const MLL& rhs) { return mod(lhs.val - (lhs / rhs).val, mdl); }
|
||||||
friend MLL operator==(const MLL& lhs, const MLL& rhs) { return lhs.val == rhs.val; }
|
friend bool operator==(const MLL& lhs, const MLL& rhs) { return lhs.val == rhs.val; }
|
||||||
friend MLL operator!=(const MLL& lhs, const MLL& rhs) { return lhs.val != rhs.val; }
|
friend bool operator!=(const MLL& lhs, const MLL& rhs) { return lhs.val != rhs.val; }
|
||||||
void operator+=(const MLL& rhs) { val = (*this + rhs).val; }
|
void operator+=(const MLL& rhs) { val = (*this + rhs).val; }
|
||||||
void operator-=(const MLL& rhs) { val = (*this - rhs).val; }
|
void operator-=(const MLL& rhs) { val = (*this - rhs).val; }
|
||||||
void operator*=(const MLL& rhs) { val = (*this * rhs).val; }
|
void operator*=(const MLL& rhs) { val = (*this * rhs).val; }
|
||||||
|
|
Loading…
Reference in New Issue