Here you can find the source of randFloat(float min, float max)
Parameter | Description |
---|---|
min | The lower bound of the range (inclusive). |
max | The upper bound of the range (inclusive). |
public static float randFloat(float min, float max)
//package com.java2s; //License from project: Apache License public class Main { /**// ww w . ja va 2 s.com * @param min The lower bound of the range (inclusive). * @param max The upper bound of the range (inclusive). * @return A random floating point value within the range given. */ public static float randFloat(float min, float max) { return (float) (min + Math.random() * ((1 + max) - min)); } }