We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92325aa commit e747e5cCopy full SHA for e747e5c
1 file changed
src/alfred/math/mod-int.hpp
@@ -13,6 +13,9 @@ class ModInt {
13
public:
14
using value_type = uint32_t;
15
static constexpr value_type mod() noexcept { return M; }
16
+ static constexpr ModInt sgn(int t) {
17
+ return t & 1 ? M - 1 : 1;
18
+ }
19
value_type v;
20
constexpr ModInt() noexcept : v(0) {}
21
constexpr ModInt(int64_t x) noexcept : v(norm(x)) {}
0 commit comments