MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / test

Function test

code/mathematics/fft.test.cpp:96–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void 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:

Callers

nothing calls this directly

Calls 3

assert_trueFunction · 0.85
randintFunction · 0.70
fastmulFunction · 0.70

Tested by

no test coverage detected