Java Random Double RandInRange(double start, double end)

Here you can find the source of RandInRange(double start, double end)

Description

Generates a random double from the start to the end provided, exclusive.

License

Open Source License

Parameter

Parameter Description
start a parameter
end a parameter

Declaration

public static double RandInRange(double start, double end) 

Method Source Code

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

public class Main {
    /**/* ww w.  j ava2 s.  c  om*/
     * Generates a random double from the start to the end provided, exclusive.
     * @param start
     * @param end
     * @return
     */
    public static double RandInRange(double start, double end) {
        return Math.random() * (end - start) + start;
    }
}

Related

  1. randDouble(double min, double max)
  2. randDouble(double min, double max)
  3. randDouble(double min, double max)
  4. randDouble(int m, int n)
  5. randIn(double min, double max)
  6. random(double low, double high)
  7. random(double min, double max)
  8. random(double min, double max)
  9. random(final double min, final double max)