This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Optimized for not checking multiples of 3 */ | |
private static boolean isPrime(double val) { | |
if (val == 0 || val == 1) return false; | |
if (val == 2 || val == 3) return true; | |
if (val % 2 == 0 || val % 3 == 0) return false; | |
for (int i = 5; i <= Math.sqrt(val); i += 4) { | |
if (val % i == 0) return false; | |
i += 2; | |
if (val % i == 0) return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initialization file (not found) |