Created
August 4, 2015 09:56
-
-
Save GnsP/1dbac77e70a7ef809400 to your computer and use it in GitHub Desktop.
test file for modular arithmatic suit
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
| #include <iostream> | |
| #include "modular.hpp" | |
| using namespace std; | |
| int main(){ | |
| modular<7> a,b,c,d; | |
| a=3; | |
| b=8; | |
| c=-5; | |
| cout<<a()<<" "<<b()<<" "<<c()<<endl; // expected 3 1 2 | |
| d = a+b; | |
| cout<<d()<<endl; //expected 4 | |
| d=b-c; | |
| cout<<d()<<endl; //expected 6 | |
| d=a*b; | |
| cout<<d()<<endl; //expected 3 | |
| d=a.addInv(); | |
| cout<<d()<<endl; //expected 4 | |
| d=a.multInv(); | |
| cout<<d()<<endl; //expected 5 | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment