PoslavskySV/rings

Cached modular inverses

michiexile opened this issue · 3 comments

For relatively small primes (say < 65k or so), precalculating all inverses and storing them in a lookup table is often faster (amortized over a long calculation in the same finite field) than recalculating each inverse whenever it is needed.

Thanks for the suggestion! I'm not sure that currently this is really needed, but at some point I'll certainly return to this.

I see. I've created a small PR #59 which addresses this issue. Is that what you need?