Closed yvesago closed 8 years ago
I feel like it would be better to make a separate library extending BigInteger.js for number theory algorithms like this. There are lots of functions that could be added at the expense of bloating the library, and I don't want the library to become a kitchen sink of random functions, beyond what it already is. A while back when this was more of my toy project than something I expected people to use, I added features that aren't useful to many people like negative and unary base conversion, and I only really keep them to maintain backwards compatibility.
I don't see this particular function being used very often, since most programmers aren't even aware of this function or how it is useful, and those who are could likely implement the function themselves without too much trouble.
A modular inverse function could be a good addons for cryptographic applications Here one sample code inspired from C sample in http://rosettacode.org/wiki/Modular_inverse