add comments to c++ impl

This commit is contained in:
jacekpoz 2024-04-12 14:04:02 +02:00
parent 5a60f7842c
commit 14cd3d8044
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

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