Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement additional IntInf operations using GMP. #44

Open
MatthewFluet opened this issue Feb 7, 2014 · 2 comments
Open

Implement additional IntInf operations using GMP. #44

MatthewFluet opened this issue Feb 7, 2014 · 2 comments

Comments

@MatthewFluet
Copy link
Member

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.

@rcythr
Copy link
Contributor

rcythr commented Dec 7, 2017

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?

@MatthewFluet
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants