Here you can find the source of randomBetween(double arg1, double arg2)
static final public int randomBetween(double arg1, double arg2)
//package com.java2s; //License from project: Apache License public class Main { static final public int randomBetween(double arg1, double arg2) { int i1 = (int) Math.ceil(arg1 < arg2 ? arg1 : arg2); int i2 = (int) Math.ceil(arg2 > arg1 ? arg2 : arg1); return i1 + (int) ((i2 - i1) * Math.random() + 0.5); }//from w ww .ja v a 2s .c o m }