10
if (n <= 1 || (n % 2 == 0 && n > 2) ) {
15
* Binary search in list.
18
return s_binary_search (SPrimeListLong, 0, S_PRIME_LIST_LONG_LEN, n);
22
* Since all non-primes are a product of two primes, we only need to check
23
* a subset of all values.
25
for (sint i = 0; i < S_PRIME_LIST_LONG_LEN; i++){
26
if (n % SPrimeListLong[i] == 0) {
31
* if we exit the loop now, and n is less than the highest value in the list
32
* squared, we have found a prime.
34
if (n <= 4999 * 4999 ) {
39
* Last chance to see if it is not a prime. This will be expensive!
41
for (sint i = 4999 + 1; i <= floor(sqrt(n)); i++) {