| 1 | #include "../code/mathematics/gcd.cpp" |
| 2 | |
| 3 | void test() { |
| 4 | for (ll a = -20; a < 20; a++) { |
| 5 | for (ll b = 2; b < 40; b++) { |
| 6 | if (gcd(a, b) == 1) { |
| 7 | assert_equal(1LL, smod((a * mod_inv(a, b)), b)); |
| 8 | } else { |
| 9 | assert_equal(-1LL, mod_inv(a, b)); |
| 10 | } |
| 11 | } |
| 12 | } |
| 13 | } |
| 14 | // vim: cc=60 ts=2 sts=2 sw=2: |
nothing calls this directly
no test coverage detected