You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
408 B

25 years ago
  1. #include "test_MI.h"
  2. int test_MI_div (int iterations)
  3. {
  4. int error = 0;
  5. int i;
  6. // Check against multiplication.
  7. for (i = iterations; i > 0; i--) {
  8. cl_I m = testrandom_I();
  9. cl_modint_ring R = cl_find_modint_ring(m);
  10. cl_I ai = testrandom_I();
  11. if (gcd(m,ai)==1) {
  12. cl_MI a = R->canonhom(ai);
  13. cl_MI b = R->canonhom(testrandom_I());
  14. ASSERT3(a*R->div(b,a) == b, m,a,b);
  15. }
  16. }
  17. return error;
  18. }