Here you can find the source of rand(double seed)
Parameter | Description |
---|---|
seed | The random number seed |
public static double rand(double seed)
//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; } }