Here you can find the source of randomFloat(float aVal)
public static float randomFloat(float aVal)
//package com.java2s; import java.util.*; public class Main { static Random _random = new Random(); /**/*w w w. j a v a2 s . c om*/ * Returns a random float up to given value. */ public static float randomFloat(float aVal) { return Math.abs(_random.nextInt()) / (float) Integer.MAX_VALUE * aVal; } }