I assume you’re referring to the Primes.jl package, since there has never been a nextprime function in Julia’s standard library as far as I know. nextprime was added there a month ago, and the behavior nextprime(p) == p for prime p was apparently based on PARI/GP and also on the nextpow2 function: https://github.com/JuliaMath/Primes.jl/pull/41

However, since this was added so recently, it probably would not be onerous to change if there are good arguments for doing so. Feel free to file an issue in Primes.jl.

Yes, I am referring to primes.jl which I regard as quasi-standard
as it houses now the expatriated Base functions isprime, primes,
primesmask and factor.

The arguments I have already implicitly given: Since the most widely
used CASs use a different definition, it is foreseeable that this will
lead to a large number of errors in the use.

Under these conditions the current implementations seem to me to be negligent.

Thank you for doing so. I was not aware of this page.

What amazes me in the discussion there is that the linguistic aspect was not mentioned, which is not unimportant for a public API.

If you are in a queue and someone calls “the next please” and no one moves because the parlance includes “=” this certainly violates the rule of least surprise for many users.

Now that I see that the author comes from France and was inspired by a piece of French software this explains much: In France and there in the French number-theoretic community the use of “is less” is indeed different from the use in the Englisch community, i.e. ‘<=’ versus ‘<’.

Maybe, adding another type Prime, we can have floor(Prime,n) and ceil(Prime,n) return the current meaning of prevprime and nextprime.

Having a Prime subtype of Integer (or Unsigned) could facilitate its use in parameters of modular arithmetic types (to make prime fields). This would lead to defining PrimePower perhaps and SmoothInteger etc. etc.

Mentioning prime powers gives me a chill. In this case PARI is fine however the OEIS is not. OEIS-A000961 even starts with a silly comment. I hope the implementator will use OEIS-A246655.