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

Function TEST

test/unittest/utils/math_test.cpp:6–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <numeric>
5
6TEST(UtilsMathTest, FactorsTest) {
7 for (int m = 1; m <= 50000; m++) {
8 auto f = factors(m);
9 int m2 = m;
10 for (auto x : f) {
11 ASSERT_EQ(0, m % x);
12 while (m2 % x == 0) m2 /= x;
13 }
14 ASSERT_EQ(1, m2);
15 }
16}
17
18bool is_primitive_root_naive(int m, int g) {
19 assert(1 <= g && g < m);

Callers

nothing calls this directly

Calls 4

is_prime_constexprFunction · 0.85
is_primitive_root_naiveFunction · 0.70
factorsFunction · 0.50
is_primitive_rootFunction · 0.50

Tested by

no test coverage detected