Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { private static Random random = new Random(); static float nextFloat(float a, float b) { return Math.min(a, b) + random.nextFloat() * Math.abs(a - b); } static float nextFloat(float a) { return random.nextFloat() * a; } }