commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gr...@apache.org
Subject svn commit: r1167454 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/MersenneTwister.java
Date Sat, 10 Sep 2011 04:43:36 GMT
Author: gregs
Date: Sat Sep 10 04:43:36 2011
New Revision: 1167454

URL: http://svn.apache.org/viewvc?rev=1167454&view=rev
Log:
Added a comment as per mail list

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/MersenneTwister.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/MersenneTwister.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/MersenneTwister.java?rev=1167454&r1=1167453&r2=1167454&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/MersenneTwister.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/MersenneTwister.java
Sat Sep 10 04:43:36 2011
@@ -142,6 +142,7 @@ public class MersenneTwister extends Bit
     public void setSeed(int seed) {
         // we use a long masked by 0xffffffffL as a poor man unsigned int
         long longMT = seed;
+        // NB: unlike original C code, we are working with java longs, the cast below makes
masking unnecessary
         mt[0]= (int) longMT;
         for (mti = 1; mti < N; ++mti) {
             // See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier.



Mime
View raw message