elliptic-shiho / primefac-fork

a fork of primefac(https://pypi.python.org/pypi/primefac) module
78 stars 12 forks source link

No `isprime` function #9

Open beroal opened 8 months ago

beroal commented 8 months ago

It is present in the primefac module of the upstream package. In your package, it is in the _primefac module. Since you changed the API, can you publish the documentation?

elliptic-shiho commented 3 months ago

Sorry for late response.

First of all, I think isprime, nextprime, and more miscellaneous functions are not API of primefac. However, the original primefac is a library with only one file, so I, or you, don't know for "this function is private one". so I think your question is also correctly one.

This software is moved some "internal functions" to _primefac module for maintainability, because the users are used another (e.g. gmpy2) library with this library as far as my observations but I still undocumented these modifications. I'm considering now for write the document for that in this year.

beroal commented 3 months ago

Hi. The documentation for “primefac” states, “As a module, we provide a primality test…”

beroal commented 3 months ago

I guess that I used isprime from this module because I needed a deterministic primality test and it implements the Baillie-Pomerance-Selfridge-Wagstaff algoritm which is deterministic for numbers less than 2**64.

elliptic-shiho commented 3 months ago

ouch, I had overlooked that statement... Thanks for pointed out that. I'll re-read it soon (~ few weeks) and try to improve the API.

elliptic-shiho commented 3 months ago

(I'll be working for this in this week ideally)