diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-21 16:19:39 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-21 16:19:39 +0100 |
| commit | b0d8a2f5f5718ba3fea628cad7bcbbc76c6a140c (patch) | |
| tree | 14fa46de9219f95858c1d7de04d1f2cb66db3e0b /zmodn.h | |
| parent | 4d9b0b7cb5c749cd1db3828ab9a3475e6c9811b6 (diff) | |
| download | zmodn-b0d8a2f5f5718ba3fea628cad7bcbbc76c6a140c.tar.gz zmodn-b0d8a2f5f5718ba3fea628cad7bcbbc76c6a140c.zip | |
Fix possible overflow with assignment operations
Diffstat (limited to 'zmodn.h')
| -rw-r--r-- | zmodn.h | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -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; } |
