Created
January 20, 2018 17:54
-
-
Save drewxa/900208ab7993985bfeb3e7b33bde96ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
template <int P> | |
class Residue | |
{ | |
public: | |
Residue(int a); | |
~Residue(); | |
bool operator == (Residue<P> b) const; | |
bool operator < (Residue<P> b) const; | |
Residue<P>& operator += (Residue<P> b) const; | |
Residue<P>& operator -= (Residue<P> b) const; | |
Residue<P>& operator *= (Residue<P> b) const; | |
Residue<P>& operator /= (Residue<P> b) const; | |
// обратный по умножению | |
// если P состовное - бросить исключение | |
Residue<P>& operator ~ () const; | |
// обратный по сложению | |
Residue<P>& operator - () const; | |
private: | |
}; | |
template <int P> | |
Residue<P> operator + (Residue<P> a, Residue<P> b); | |
template <int P> | |
Residue<P> operator - (Residue<P> a, Residue<P> b); | |
template <int P> | |
Residue<P> operator * (Residue<P> a, Residue<P> b); | |
template <int P> | |
Residue<P> operator / (Residue<P> a, Residue<P> b); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment