mlton
mlton copied to clipboard
Implement additional IntInf operations using GMP.
There are a number of number theoretic functions implemented by GMP that would be beneficial to implement and expose as MLton.IntInf.*
functions. In particular, lcm
(least common multiple) would be useful to implement.
Although all of these functions are probably useful for some users, it is worth mentioning that for every additional function we add here the scope of #60 increases.
That said, I did some analysis and work on this item to familiarize myself with the codebase. My current change on feature/extra_gmp_functions adds support for lcm
so far.
Here are the other functions that jumped out to me as being interesting. Bolded functions can reuse the GC helper functions IntInf_binop
or IntInf_unop
, and are the easiest to implement:
From Number Theoretic
- mpz_probab_prime_p
- mpz_nextprime
- mpz_jacobi
- mpz_legendre
- mpz_kronecker
- mpz_remove
From Integer Roots
- mpz_root
- mpz_rootrem
- mpz_sqrt
- mpz_sqrtrem
- mpz_perfect_power_p
- mpz_perfect_square_p
Should we add the above functions, a subset of the above functions, or just lcm
?
I think those that can reuse existing helper functions should be straightforward to add. And then maybe also the predicate (_p
) functions.