开发者

Is there a way to optimize reducing many numbers to the same modulus

开发者 https://www.devze.com 2023-01-16 02:56 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号