std-primep


Synopsis

(std-primep <num>)

Description

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.

Examples

(std-primep 21)      	=> nil
(std-primep 10000005)	=> nil, 0 ms
(std-primep 10000007)	=> nil, 361 ms

Arguments

num: Any positive integer number.

Return Value

T or nil.

Side Effects

Stores a intermediate list of prime numbers in the global symbol *PRIMES* to speed up further calculations.

Also sets *LASTDIV* as described above.

Module

(std-require 'PRIMES)

Defined in PRIMES.LSP