Last active
March 22, 2017 08:45
-
-
Save Dyndrilliac/487fc06ddc47ab55968180358c60691b to your computer and use it in GitHub Desktop.
PrimeTest
This file contains 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
import api.util.Mathematics; | |
public class PrimeTest | |
{ | |
public static void main(String[] args) | |
{ | |
int n = -4; | |
StdOut.println(Mathematics.isEven(n)); // true | |
StdOut.println(Mathematics.isPrime(n)); // false | |
StdOut.println(Mathematics.makePrimeGreater(1)); // 2 | |
StdOut.println(Mathematics.makePrimeGreater(n) + "\n"); // 2 | |
//StdOut.println(Long.MAX_VALUE); // 9223372036854775807 | |
//StdOut.println(Mathematics.makePrimeLesser(Long.MAX_VALUE)); // 9223372036854775783 | |
//StdOut.println(Mathematics.makePrimeLesser(n)); // Throws IllegalArgumentException | |
//StdOut.println(Mathematics.makePrimeGreater(Long.MAX_VALUE)); // Throws IllegalArgumentException | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment