Skip to content

Commit 8821656

Browse files
committed
adjust modint
1 parent cb237ef commit 8821656

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cpp/numbertheory/modint.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ struct modint {
5151
return u;
5252
}
5353

54+
bool operator==(modint rhs) { return value == rhs.value; }
55+
56+
bool operator!=(modint rhs) { return !(*this == rhs); }
57+
5458
friend modint operator+(modint lhs, modint rhs) { return lhs += rhs; }
5559

5660
friend modint operator-(modint lhs, modint rhs) { return lhs -= rhs; }
5761

5862
friend modint operator*(modint lhs, modint rhs) { return lhs *= rhs; }
5963

6064
friend modint operator/(modint lhs, modint rhs) { return lhs /= rhs; }
61-
62-
friend bool operator==(modint lhs, modint rhs) { return lhs.value == rhs.value; }
63-
64-
friend bool operator!=(modint lhs, modint rhs) { return lhs.value != rhs.value; }
6565
};

0 commit comments

Comments
 (0)