Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gmpints: remove invalid ModInt return value treatment
Before returning the computed result, ModInt checked whether it was negative, it flipped the sign. This should (a) never be necessary, because the preceding computations should always produce something non-negative, and (b) would be mathematically incorrect. Instead, we simply return the result untreated, and added an assertion triggering if we ever see a negative result here (only enabled if DEBUG_GMP is set).
- Loading branch information