Forum Moderators: open
public double nextDouble() {
return (((long)next(26) << 27) + next(27))
/ (double)(1L << 53);
}
Source: [java.sun.com...]
JavaScript's standard library follows Java's naming conventions, and JavaScript's Math and Date objects are based on classes from Java 1.0.
Source: [en.wikipedia.org...]
However, in the latest official standard for JavaScript, called ECMA-script, this is written:
Returns a Number value with positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-dependent algorithm or strategy
ECMA-262, December 2009: [ecma-international.org...]
So: Most likely it depends on the browser, and most likely the browser maker won't tell you.
As for decimal places, that depends on your PC hardware, your operating system, and most likely also on your browser. So that would be unpredictable, but certainly not random ;)