diff --git a/lab2/zad1/include/GF.hpp b/lab2/zad1/include/GF.hpp index c622079..7f719ba 100644 --- a/lab2/zad1/include/GF.hpp +++ b/lab2/zad1/include/GF.hpp @@ -50,6 +50,9 @@ public: return this->operator*(GF(rhs)); } + /* + * throws std::invalid_argument when dividing by 0 + */ GF operator/(const GF &rhs) const { if (rhs._value == 0) { throw std::invalid_argument("division by 0 is illegal"); @@ -117,7 +120,13 @@ public: return stream; } + /* + * returns the characteristic of this GF + */ uint characteristic() const { return N; } + /* + * returns the value of this GF + */ uint value() const { return _value; } };