markrogoyski / math-php

Powerful modern math library for PHP: Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra
MIT License
2.35k stars 241 forks source link

Integer Modulo n #436

Open muratcankilic96 opened 3 years ago

muratcankilic96 commented 3 years ago

Are there any future plans to add integer modulo n?

I mean features such as multiplicative/additive inverses modulo n, order a modulo n, primitive roots modulo n, quadratic residues etc.

markrogoyski commented 3 years ago

Hi @muratcankilic96,

Thank you for your interest in MathPHP. And thank you for your feature request.

We can consider modular arithmetic for upcoming feature development. What kinds of things are you looking to do? And what specific functions do you consider "must haves" vs "nice to have?"

And are there any reference libraries with similar functionality that you think have good interfaces/APIs (or bad interfaces/APIs)?

Thanks, Mark

muratcankilic96 commented 3 years ago

Hello @markrogoyski

Thanks for replying.

Must have features are:

Nice to have:

For reference, I have implemented several modular arithmetic features myself in C#. We need Euler totient function and MathPHP already supports that.

Beakerboy commented 3 years ago

If you have already implemented several of these in another language, please translate them into PHP, add some unit tests, and submit the work in a merge request. That would be the fastest way to see these features in this library.