MCPcopy Create free account
hub / github.com/atcoder/ac-library / TEST

Function TEST

test/unittest/internal_math_test.cpp:45–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45TEST(InternalMathTest, Barrett) {
46 for (int m = 1; m <= 100; m++) {
47 internal::barrett bt(m);
48 for (int a = 0; a < m; a++) {
49 for (int b = 0; b < m; b++) {
50 ASSERT_EQ((a * b) % m, bt.mul(a, b));
51 }
52 }
53 }
54
55 internal::barrett bt(1);
56 ASSERT_EQ(0, bt.mul(0, 0));
57}
58
59TEST(InternalMathTest, BarrettIntBorder) {
60 const int mod_upper = std::numeric_limits<int>::max();

Callers

nothing calls this directly

Calls 8

is_prime_constexprFunction · 0.85
safe_modFunction · 0.85
inv_gcdFunction · 0.85
primitive_root_constexprFunction · 0.85
mulMethod · 0.80
is_prime_naiveFunction · 0.70
gcdFunction · 0.70
is_primitive_rootFunction · 0.70

Tested by

no test coverage detected