Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool IsPrimeMoreEfficient(BigInteger num)
- {
- if (num < 2) return false;
- if (num < 4) return true;
- if (num % 2 == 0) return false;
- for (BigInteger u = 3; u*u <= num; u += 2)
- if (num % u == 0) return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement