Skip to content

Commit

Permalink
fixed gcd.i:is_prime function
Browse files Browse the repository at this point in the history
  • Loading branch information
dhmunro committed Mar 5, 2016
1 parent 01e228e commit bc24b71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion i/gcd.i
Expand Up @@ -72,7 +72,7 @@ func is_prime(x)
*/
{
x= long(abs(x));
if (x<2) return x==1;
if (x<4) return x>0;
/* make a list of factors which includes 2, 3, and all larger
odd numbers not divisible by 3 less or equal to sqrt(x) */
top= min(long((sqrt(x)+8.)/3.+0.5), 20000);
Expand Down

0 comments on commit bc24b71

Please sign in to comment.