2 isprime - whether a small integer is prime
14 Determine if x is is a small prime. This function will return
15 1 if x is a small prime. If x is even, this function will
16 return 0. If x is negative or a small composite (non-prime),
19 If x is a large positive odd value and the err argument is
20 given, this function return err. If x is a large positive odd
21 value and the err argument is not given, an error will be
24 Note that normally this function returns the integer 0 or 1.
25 If err is given and x is a large positive odd value, then err
29 > print isprime(-3), isprime(1), isprime(2)
32 > print isprime(21701), isprime(1234577), isprime(1234579)
35 > print isprime(2^31-9), isprime(2^31-1), isprime(2^31+11)
38 > print isprime(2^32+1, -1), isprime(3^99, 2), isprime(4^99, 2)
42 err not given and (y is even or y < 2^32)
45 FLAG zisprime(ZVALUE x) (return 1 if prime, 0 not prime, -1 if >= 2^32)
48 factor, lfactor, nextprime, prevprime, pfact, pix,
49 isassoc, isatty, isblk, isconfig, isdefined, iserror, iseven, isfile,
50 ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj,
51 isobjtype, isodd, isrand, israndom, isreal, isrel,
52 issimple, issq, isstr, istype