mlton icon indicating copy to clipboard operation
mlton copied to clipboard

Implement additional IntInf operations using GMP.

Open MatthewFluet opened this issue 11 years ago • 2 comments

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.

MatthewFluet avatar Feb 07 '14 18:02 MatthewFluet

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?

rcythr avatar Dec 07 '17 18:12 rcythr

I think those that can reuse existing helper functions should be straightforward to add. And then maybe also the predicate (_p) functions.

MatthewFluet avatar Dec 08 '17 11:12 MatthewFluet