Closed JASory closed 2 years ago
I intentionally didn't include the primality check in the legendre function, because this crate doesn't deal with anything with primality test. This is clearly stated in the documentation
I intentionally didn't include the primality check in the legendre function, because this crate doesn't deal with anything with primality test. This is clearly stated in the documentation
https://docs.rs/num-modular/0.5.1/num_modular/trait.ModularSymbols.html#tymethod.checked_legendre
@JASory The doc says
Checked version of legendre(), return None if n is not prime
This doesn't mean that it will do a full primality check (you can check the implementation). But the doc definitely needs to be improved, thanks for pointing out and I will make this clear
a^p-1 = 1 mod p is a necessary but not sufficient condition for primality. This is resulting in an extremely high error rate.