diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-01-21 08:03:15 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-01-21 08:03:21 +0100 |
| commit | 97c94018402c95f2ed1f59645f4b1cbdd255b978 (patch) | |
| tree | 01143ccecff8b4ac74b233767d380ab4485338ac /templates/zmodn-1.cpp | |
| parent | 6cfb7b4d8e6b0838bfcde290e5fac18f46f18fb4 (diff) | |
| download | taming-cpp-97c94018402c95f2ed1f59645f4b1cbdd255b978.tar.gz taming-cpp-97c94018402c95f2ed1f59645f4b1cbdd255b978.zip | |
Final examples for templates
Diffstat (limited to '')
| -rw-r--r-- | templates/zmodn-1.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/templates/zmodn-1.cpp b/templates/zmodn-1.cpp index a8e26ca..1c1450b 100644 --- a/templates/zmodn-1.cpp +++ b/templates/zmodn-1.cpp | |||
| @@ -14,7 +14,6 @@ public: | |||
| 14 | int value; | 14 | int value; |
| 15 | 15 | ||
| 16 | Zmod(int z) : value{(z%N + N) % N} {} | 16 | Zmod(int z) : value{(z%N + N) % N} {} |
| 17 | int toint() const { return value; } | ||
| 18 | 17 | ||
| 19 | Zmod operator+(const Zmod& z) const { return value + z.value; } | 18 | Zmod operator+(const Zmod& z) const { return value + z.value; } |
| 20 | Zmod operator-(const Zmod& z) const { return value - z.value; } | 19 | Zmod operator-(const Zmod& z) const { return value - z.value; } |
