Here you can find the source of randRangeDecimal(float min, float max)
Parameter | Description |
---|---|
min | the value for the bottom range. |
max | the value for the upper range. |
public static float randRangeDecimal(float min, float max)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w. j a v a 2 s . c o m * Calculates a random number within a minimum and maximum range. * @param min the value for the bottom range. * @param max the value for the upper range. * @return the random number within the range. * @use {@code var vRandRange = MathUtil.randRangeDecimal( 0, 999999 );} */ public static float randRangeDecimal(float min, float max) { return (float) Math.random() * (max - min) + min; } }