std-primep | ![]() |
Returns T if the number is a prime number or nil otherwise.
As sideeffect it may also store the lowest found divisor in the global *LASTDIV*, but only if some new prime numbers will have to be calculated.
(std-primep 21) => nil (std-primep 10000005) => nil, 0 ms (std-primep 10000007) => nil, 361 ms
num: Any positive integer number.
T or nil.
Stores a intermediate list of prime numbers in the global symbol *PRIMES* to speed up further calculations.
Also sets *LASTDIV* as described above.
(std-require 'PRIMES)
Defined in PRIMES.LSP