Closed
Description
Line 676 in d2b35ac
Line 1046 in d2b35ac
Line 1048 in d2b35ac
The identity of multiplication should be Self::new(1)
(not raw
but new
), because of following (corner) cases:
use ac_library_rs::ModInt;
ModInt::set_modulus(1); // !!
let x: ModInt = std::iter::empty::<ModInt>().product();
assert_eq!(x.val(), 0);
let y = ModInt::new(123).pow(0);
assert_eq!(y.val(), 0);
Note that the original ACL allows to use modint::set_mod(1)
.