Java Random Double rand(double seed)

Here you can find the source of rand(double seed)

Description

Return a random number, which is also the next seed.

License

Open Source License

Parameter

Parameter Description
seed The random number seed

Declaration

public static double rand(double seed) 

Method Source Code

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

public class Main {
    public static final double A = 16807.0;
    public static final double M = 2147483647.0;

    /** // w  ww .  j a va2s.  c o  m
     * Return a random number, which is also the next seed. 
     *
     * @param seed  The random number seed
     */
    public static double rand(double seed) {
        double t = A * seed + 1;
        seed = t - (M * Math.floor(t / M));
        return seed;

    }
}

Related

  1. getDouble()
  2. getDoubleInRange(double minValue, double maxValue)
  3. getDoubleSpecial()
  4. getRandomDouble()
  5. getRandomDouble(double min, double max)
  6. randDouble()
  7. randDouble(double min, double max)
  8. randDouble(double min, double max)
  9. randDouble(double min, double max)