Here you can find the source of randRange(float from, float to)
public static float randRange(float from, float to)
//package com.java2s; //License from project: Apache License public class Main { public static float randRange(float from, float to) { return ((float) Math.random() * (to - from)) + from; }/*w w w . j a va2s . c o m*/ public static int randRange(int from, int to) { return (int) (Math.random() * (to - from)) + from; } }