Is there a way to optimize reducing many numbers to the same modulus
I am writing a program to do integer factorization and have to reduce a series of numbers to a given modulus. Both the number and the modulus are bigints, say 50 t开发者_StackOverflow中文版o 100 digits. The number changes but the modulus is always the same. Is there some way to optimize the repeated modulus calculations, perhaps by pre-computing some partial results and storing them in a table?
Let your bigint library worry about optimizing operations like that.
精彩评论