Used to get a completely(-1.0D - 1.0D) random double. - Java java.util

Java examples for java.util:Random

Description

Used to get a completely(-1.0D - 1.0D) random double.

Demo Code


//package com.java2s;
import java.util.Random;

public class Main {
    /**/* ww  w  .  j  a v a  2 s  . c  o  m*/
     * Used to get a completely(-1.0D - 1.0D) random double.
     * @version From DummyCore 1.0
     * @param rand - the Random, that will randomise this.
     * @return a random Double
     */
    public static double randomDouble(Random rand) {
        return rand.nextDouble() - rand.nextDouble();
    }
}

Related Tutorials