diff options
| author | Joe Darcy <darcy@openjdk.org> | 2021-01-25 19:06:56 +0000 |
|---|---|---|
| committer | Joe Darcy <darcy@openjdk.org> | 2021-01-25 19:06:56 +0000 |
| commit | 73c78c8aa093a150f7277391abe2418a0c8a1f7a (patch) | |
| tree | 27dc568085a23dbb84a483eb3d578c95e80dfd66 /src/java.base/share/classes/java/util/Random.java | |
| parent | 5b0b24b58d5fc3dbcba2905deb87129cb296dc47 (diff) | |
| download | openjdk-73c78c8aa093a150f7277391abe2418a0c8a1f7a.tar.gz openjdk-73c78c8aa093a150f7277391abe2418a0c8a1f7a.zip | |
8260329: Update references to TAOCP to latest edition
Reviewed-by: alanb, bpb
Diffstat (limited to 'src/java.base/share/classes/java/util/Random.java')
| -rw-r--r-- | src/java.base/share/classes/java/util/Random.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/java.base/share/classes/java/util/Random.java b/src/java.base/share/classes/java/util/Random.java index c4f07d33a0c..2dc5e3d5b37 100644 --- a/src/java.base/share/classes/java/util/Random.java +++ b/src/java.base/share/classes/java/util/Random.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,8 +39,9 @@ import jdk.internal.misc.Unsafe; /** * An instance of this class is used to generate a stream of * pseudorandom numbers. The class uses a 48-bit seed, which is - * modified using a linear congruential formula. (See Donald Knuth, - * <i>The Art of Computer Programming, Volume 2</i>, Section 3.2.1.) + * modified using a linear congruential formula. (See Donald E. Knuth, + * <cite>The Art of Computer Programming, Volume 2, Third + * edition: Seminumerical Algorithms</cite>, Section 3.2.1.) * <p> * If two instances of {@code Random} are created with the same * seed, and the same sequence of method calls is made for each, they @@ -187,8 +188,8 @@ public class Random implements java.io.Serializable { * * This is a linear congruential pseudorandom number generator, as * defined by D. H. Lehmer and described by Donald E. Knuth in - * <i>The Art of Computer Programming,</i> Volume 2: - * <i>Seminumerical Algorithms</i>, section 3.2.1. + * <cite>The Art of Computer Programming, Volume 2, Third edition: + * Seminumerical Algorithms</cite>, section 3.2.1. * * @param bits random bits * @return the next pseudorandom value from this random number @@ -569,8 +570,8 @@ public class Random implements java.io.Serializable { * } * }}</pre> * This uses the <i>polar method</i> of G. E. P. Box, M. E. Muller, and - * G. Marsaglia, as described by Donald E. Knuth in <i>The Art of - * Computer Programming</i>, Volume 2: <i>Seminumerical Algorithms</i>, + * G. Marsaglia, as described by Donald E. Knuth in <cite>The Art of + * Computer Programming, Volume 2, third edition: Seminumerical Algorithms</cite>, * section 3.4.1, subsection C, algorithm P. Note that it generates two * independent values at the cost of only one call to {@code StrictMath.log} * and one call to {@code StrictMath.sqrt}. @@ -581,7 +582,7 @@ public class Random implements java.io.Serializable { * generator's sequence */ public synchronized double nextGaussian() { - // See Knuth, ACP, Section 3.4.1 Algorithm C. + // See Knuth, TAOCP, Vol. 2, 3rd edition, Section 3.4.1 Algorithm C. if (haveNextNextGaussian) { haveNextNextGaussian = false; return nextNextGaussian; |
