Here you can find the source of randomInt(double arg)
static final public double randomInt(double arg)
//package com.java2s; //License from project: Apache License public class Main { static final public double randomInt(double arg) { double d = Math.ceil(Math.abs(arg)); return 1 + Math.floor(d * Math.random()); }// w w w . j av a 2s. c o m }