Java Random Double randRealUniform(double minrange, double maxrange)

Here you can find the source of randRealUniform(double minrange, double maxrange)

Description

Generates a random real number in the given range.

License

Open Source License

Parameter

Parameter Description
minrange - minimum value
maxrange - maximum value

Return

- random number

Declaration

public static double randRealUniform(double minrange, double maxrange) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//  w ww.j a  v  a2  s .  c om
     * Generates a random real number in the given range. 
     * 
     * @param minrange - minimum value
     * @param maxrange - maximum value
     * @return - random number
     */
    public static double randRealUniform(double minrange, double maxrange) {
        return minrange + (Math.random() * (maxrange - minrange));
    }
}

Related

  1. randomIn(double in)
  2. randomInitialize(double[] base)
  3. randomInRange(double min, double max)
  4. randomPercent(double percent)
  5. randomRange(double min, double max)