aboutsummaryrefslogtreecommitdiff
path: root/zmodn.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-12-21 16:19:39 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2024-12-21 16:19:39 +0100
commitb0d8a2f5f5718ba3fea628cad7bcbbc76c6a140c (patch)
tree14fa46de9219f95858c1d7de04d1f2cb66db3e0b /zmodn.h
parent4d9b0b7cb5c749cd1db3828ab9a3475e6c9811b6 (diff)
downloadzmodn-b0d8a2f5f5718ba3fea628cad7bcbbc76c6a140c.tar.gz
zmodn-b0d8a2f5f5718ba3fea628cad7bcbbc76c6a140c.zip
Fix possible overflow with assignment operations
Diffstat (limited to 'zmodn.h')
-rw-r--r--zmodn.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/zmodn.h b/zmodn.h
index 562aa22..f161ad1 100644
--- a/zmodn.h
+++ b/zmodn.h
@@ -17,9 +17,9 @@ public:
17 Zmod operator+(const Zmod& z) const { return int64 + z.int64; } 17 Zmod operator+(const Zmod& z) const { return int64 + z.int64; }
18 Zmod operator-(const Zmod& z) const { return int64 - z.int64; } 18 Zmod operator-(const Zmod& z) const { return int64 - z.int64; }
19 Zmod operator*(const Zmod& z) const { return int64 * z.int64; } 19 Zmod operator*(const Zmod& z) const { return int64 * z.int64; }
20 Zmod operator+=(const Zmod& z) { return int64 += z.int64; } 20 Zmod operator+=(const Zmod& z) { return (*this) = int64 + z.int64; }
21 Zmod operator-=(const Zmod& z) { return int64 -= z.int64; } 21 Zmod operator-=(const Zmod& z) { return (*this) = int64 - z.int64; }
22 Zmod operator*=(const Zmod& z) { return int64 *= z.int64; } 22 Zmod operator*=(const Zmod& z) { return (*this) = int64 * z.int64; }
23 23
24 bool operator==(const Zmod& z) const { return int64 == z.int64; } 24 bool operator==(const Zmod& z) const { return int64 == z.int64; }
25 bool operator!=(const Zmod& z) const { return int64 != z.int64; } 25 bool operator!=(const Zmod& z) const { return int64 != z.int64; }