| 94 | } |
| 95 | |
| 96 | void test() { |
| 97 | /* Field testing: Kattis {polymul1,polymul2}, SPOJ {MUL,TMUL,VFMUL} */ |
| 98 | |
| 99 | int ts = 100, |
| 100 | l1 = 1, |
| 101 | l2 = 1000; |
| 102 | |
| 103 | for (int t = 0; t < ts; t++) |
| 104 | { |
| 105 | int la = uniform_int_distribution(l1, l2)(rng), |
| 106 | lb = uniform_int_distribution(l1, l2)(rng); |
| 107 | |
| 108 | intx a = randint(la), |
| 109 | b = randint(lb), |
| 110 | c1 = a * b, |
| 111 | c2 = fastmul(a, b); |
| 112 | |
| 113 | bool same = !(c1 < c2 || c2 < c1); |
| 114 | assert_true(same); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | // vim: cc=60 ts=2 sts=2 sw=2: |
nothing calls this directly
no test coverage detected