Update include.hh
Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
parent
6e6d8fd24e
commit
2d83af3ae5
10
include.hh
10
include.hh
|
@ -385,11 +385,11 @@ struct MLLd {
|
||||||
ll val, mdl;
|
ll val, mdl;
|
||||||
MLLd(ll mdl, ll v = 0) : mdl(mdl), val(mod(v, mdl)) {}
|
MLLd(ll mdl, ll v = 0) : mdl(mdl), val(mod(v, mdl)) {}
|
||||||
MLLd(const MLLd& other) : val(other.val) {}
|
MLLd(const MLLd& other) : val(other.val) {}
|
||||||
friend MLLd operator+(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val + rhs.val, mdl); }
|
friend MLLd operator+(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val + rhs.val, lhs.mdl); }
|
||||||
friend MLLd operator-(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val - rhs.val, mdl); }
|
friend MLLd operator-(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val - rhs.val, lhs.mdl); }
|
||||||
friend MLLd operator*(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val * rhs.val, mdl); }
|
friend MLLd operator*(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val * rhs.val, lhs.mdl); }
|
||||||
friend MLLd operator/(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val * mod(inverse(rhs.val, mdl), mdl), mdl); }
|
friend MLLd operator/(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val * mod(inverse(rhs.val, lhs.mdl), lhs.mdl), lhs.mdl); }
|
||||||
friend MLLd operator%(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val - (lhs / rhs).val, mdl); }
|
friend MLLd operator%(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val - (lhs / rhs).val, lhs.mdl); }
|
||||||
friend bool operator==(const MLLd& lhs, const MLLd& rhs) { return lhs.val == rhs.val; }
|
friend bool operator==(const MLLd& lhs, const MLLd& rhs) { return lhs.val == rhs.val; }
|
||||||
friend bool operator!=(const MLLd& lhs, const MLLd& rhs) { return lhs.val != rhs.val; }
|
friend bool operator!=(const MLLd& lhs, const MLLd& rhs) { return lhs.val != rhs.val; }
|
||||||
void operator+=(const MLLd& rhs) { val = (*this + rhs).val; }
|
void operator+=(const MLLd& rhs) { val = (*this + rhs).val; }
|
||||||
|
|
Loading…
Reference in New Issue