Here you can find the source of randomFloat(float min, float max)
public static float randomFloat(float min, float max)
//package com.java2s; //License from project: Open Source License public class Main { public static float randomFloat(float min, float max) { return (float) (Math.random() * (max - min) + min); }//from ww w .java2 s .c om public static int random(int min, int max) { return Math.round((float) Math.random() * (max - min)) + min; } }