Replacing math theory with code in primes docstring

I would like to change the docstring for primes as follows, to reduce theory and use code that the user can use directly. Please comment if this is OK.

primes_doc.diff (996 Bytes)
Old:

 -- P = primes (N)
     Return all primes up to N.

     The output data class (double, single, uint32, etc.) is the same as
     the input class of N.  The algorithm used is the Sieve of
     Eratosthenes.

     Note: If you need a specific number of primes you can use the fact
     that the distance from one prime to the next is, on average,
     proportional to the logarithm of the prime.  Integrating, one finds
     that there are about k primes less than k*log (5*k).

     See also 'list_primes' if you need a specific number N of primes.

     See also: list_primes, isprime.

Proposed:

 -- P = primes (N)
     Return all primes up to N.

     The output data class (double, single, uint32, etc.) is the same as
     the input class of N.  The algorithm used is the Sieve of
     Eratosthenes.

     Note: For a specific number N of primes, call 'list_primes (N)', or
     also 'primes (N*log (K*N))(1:N)' where K is about 5 or 6.

     See also: list_primes, isprime.
1 Like

I like the addition, but I’d recommend it still be followed by the explanation from the original note, or maybe an abbreviated version.

1 Like

Yes . Combine the 2, don’t remove the first one.

1 Like

Thanks. I pushed the modified change to octave: 9a722a4316b6