Java Random Double randDouble(double min, double max)

Here you can find the source of randDouble(double min, double max)

Description

Get a random double within the provided range.

License

Open Source License

Parameter

Parameter Description
min The minimum value.
max The maximum value.

Return

A random double within the provided range.

Declaration

public static double randDouble(double min, double max) 

Method Source Code

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

public class Main {
    /**/*ww  w  .  java  2  s  . c o m*/
     * Get a random double within the provided range.
     *
     * @param min The minimum value.
     * @param max The maximum value.
     * @return A random double within the provided range.
     */
    public static double randDouble(double min, double max) {
        return min + (Math.random() * ((max - min) + 1));
    }
}

Related

  1. getRandomDouble()
  2. getRandomDouble(double min, double max)
  3. rand(double seed)
  4. randDouble()
  5. randDouble(double min, double max)
  6. randDouble(double min, double max)
  7. randDouble(double min, double max)
  8. randDouble(int m, int n)
  9. randIn(double min, double max)