package utils; import java.util.Random; public class MathTools { public static double round(double n, int places) { return (Math.round(n * Math.pow(10, places))) / Math.pow(10, places); } public static double random(double minLimit, double maxLimit) { Random rand = new Random(); return rand.nextDouble(minLimit, maxLimit); } public static boolean isNumPrime(int n) { if (n <= 1) return false; for (int i = 2; i < n; i++) if (n % i == 0) return false; return true; } }