Java Random Double getDouble()

Here you can find the source of getDouble()

Description

get Double

License

Open Source License

Declaration

public static double getDouble() 

Method Source Code


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

import java.util.Random;

public class Main {
    public static final Random random = new Random();

    public static double getDouble() {
        return random.nextDouble();
    }/*from w  w w .ja va 2  s.  c  om*/

    public static double getDouble(double max) {
        return getDouble() * max;
    }

    public static double getDouble(double min, double max) {
        return max > min ? min + getDouble(max - min) : min;
    }
}

Related

  1. generateRandomDoubleInRange(double min, double max)
  2. generateRandomLongitude()
  3. getDouble()
  4. getDoubleInRange(double minValue, double maxValue)
  5. getDoubleSpecial()
  6. getRandomDouble()