up previous next
IsPPrime

checks if an integer is a probable prime
Syntax
          
IsPPrime(N:INT):BOOL

          

Description
This function returns True if its integer argument passes a fairly stringent primality test; otherwise it returns False. There is a very small chance of the function returning True even though the argument is composite; if it returns False, we are certain that the argument is composite. Some people call it a compositeness test.

Example
  IsPPrime(2);
True
-------------------------------
  IsPPrime(1111111111111111111);
True
-------------------------------
  [N In 1..1111 | IsPPrime((10^N-1)/9)]; -- only five values are known
[2, 19, 23, 317, 1031]                   -- next might be 49081
-------------------------------


See Also