-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfield_test.cpp
31 lines (28 loc) · 1.14 KB
/
field_test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/******************************************************************************
Copyright (C) 2013 Karel Ha <[email protected]>
Distributed under the terms of the GNU General Public License (GPL)
as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
http://www.gnu.org/licenses/
******************************************************************************/
#include "all.hpp"
int main(int argc, const char* argv[]) {
cout << "Field of reals: " << endl;
double pi = 3.14;
double e = 2.71;
cout << fld_reals._zero << endl;
cout << fld_reals._one << endl;
cout << fld_reals._plus(e, pi) << endl;
cout << fld_reals._times(e, pi) << endl;
cout << fld_reals._minus(e) << endl;
cout << fld_reals._minus(pi) << endl;
cout << fld_reals.subtract(e, pi) << endl;
cout << fld_reals._rec(pi) << endl;
//cout << fld_reals.reciprocal(0) << endl;
cout << "Prime field of order " << _order_ << ": " << endl;
cout << pf._minus(-79) << endl;
cout << pf._plus(-79, 132) << endl;
cout << pf._times(-78, 134) << endl;
cout << pf._rec(29) << endl;
return 0;
}