| 9 | } |
| 10 | |
| 11 | void test() { |
| 12 | /* Field testing: SPOJ {MUL,TMUL,VFMUL} */ |
| 13 | |
| 14 | int ts = 1000, |
| 15 | l1 = 1, |
| 16 | l2 = 1000; |
| 17 | |
| 18 | for (int t = 0; t < ts; t++) { |
| 19 | // printf("%d\n", t); |
| 20 | |
| 21 | int la = uniform_int_distribution(l1, l2)(rng), |
| 22 | lb = uniform_int_distribution(l1, l2)(rng); |
| 23 | |
| 24 | intx a = randint(la), |
| 25 | b = randint(lb), |
| 26 | c1 = a * b, |
| 27 | c2 = fastmul(a, b); |
| 28 | |
| 29 | bool same = !(c1 < c2 || c2 < c1); |
| 30 | assert_true(same); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | // vim: cc=60 ts=2 sts=2 sw=2: |
nothing calls this directly
no test coverage detected