I want to return the number as long as it falls within a limit, else return the maximum or minimum value of the limit. I can do this with a combination of Math.min
You do not need an external library for this, try this test case:
public class RandomNumber {
public static void main(String[] Args) {
System.out.println("random = " + randomInRange(5,10));
}
public static double randomInRange(double arg1, double arg2) {
double my_number = Math.ceil(Math.random() * (arg1 - arg2) + arg2);
return my_number;
}
}