I have Ruby/Crystal code that uses arbitrary precision integer numbers (really BIG numbers). Looking at Nim's math libraries they don't appear to be arbitrary precision.
https://nim-lang.org/docs/lib.html#pure-libraries-math-libraries
I need at least the following operators:
gcd(a,b)
modinv(a,b) -> (a^-1) base b -> a*(a^-1) mod b = 1
modpow(a,e,b) -> a^e mod b
intsqrt(a) -> a ^(1/2)
introotn(a,n) -> a^(1/n)
All the algorithms are fairly simple (a few lines of code), but does Nim use arbitrary math lib?
Are the nimble packages bignum and bigints not good enough for you?
I think one is a wrapper, the other is pure Nim from smart Mr. Felsing.
Curiously, I have found Python (using "pypy" interpreter) to be more performing when dealing with long integers than Nim with "bignum" (for instance when doing Rabbin-Miller primality tests). So, it seems there is still room for some improvement.
You can also check my own number theory repo: https://github.com/numforge/number-theory which is just a reorganization of code I've used for Project Euler (my repo here).
Of note it will provide a template that replace all operations in a scope by modulo operation:
import number_theory
modulo(42):
let x = 10 + 50
let y = x ^ 10
echo y
Currently it does not work though, you get stack overflow because the +/-/mul/div within addmod, submod, etc are also replaced ...
Edit @lsrcd: Python is probably using libmpdec too: http://www.bytereef.org/mpdecimal/
I'm pretty sure it's not planned for 1.0.
Now due to the need of arbitrary precision floating point arithmetic for currencies/finance at Status, we wrapped mpdecimal, available here. Now the wrapper is below low-level and overload like + must be created on top of mpd_add.
Further contributions welcome.