]> www.ginac.de Git - cln.git/blob - tests/test_MI_recip.cc
* All Files have been modified for inclusion of namespace cln;
[cln.git] / tests / test_MI_recip.cc
1 #include "test_MI.h"
2
3 int test_MI_recip (int iterations)
4 {
5         int error = 0;
6         int i;
7         // Check against multiplication.
8         for (i = iterations; i > 0; i--) {
9                 cl_I m = testrandom_I();
10                 cl_modint_ring R = find_modint_ring(m);
11                 cl_I ai = testrandom_I();
12                 if (gcd(m,ai)==1) {
13                         cl_MI a = R->canonhom(ai);
14                         ASSERT2(a*R->recip(a) == R->one(), m,a);
15                 }
16         }
17         return error;
18 }