Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn committed Oct 7, 2024
1 parent b8f1b97 commit ee5a871
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cp-algo/number_theory/modint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace cp_algo::math {
}
modint_base(): r(0) {}
modint_base(int64_t rr): r(rr % mod()) {
r = std::min(r, r + 2 * mod());
r = std::min(r, r + mod());
r = m_transform(r);
}
modint inv() const {
Expand Down Expand Up @@ -99,7 +99,7 @@ namespace cp_algo::math {
return std::min(res, res - mod());
}
void setr_direct(uint64_t rr) {r = rr;}
uint64_t getr_direct() const {return r;}
uint64_t getr_direct() const {return std::min(r, r - mod());}
private:
uint64_t r;
modint& to_modint() {return static_cast<modint&>(*this);}
Expand Down

0 comments on commit ee5a871

Please sign in to comment.