commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r906518 - /commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java
Date Thu, 04 Feb 2010 15:15:20 GMT
Author: sebb
Date: Thu Feb  4 15:15:20 2010
New Revision: 906518

URL: http://svn.apache.org/viewvc?rev=906518&view=rev
Log:
Use the super implementation for boolean and float as they are likely to be better

Modified:
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java?rev=906518&r1=906517&r2=906518&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/math/JVMRandom.java
Thu Feb  4 15:15:20 2010
@@ -151,7 +151,7 @@
      * @return the random boolean
      */
     public boolean nextBoolean() {
-        return SHARED_RANDOM.nextDouble() > 0.5;
+        return SHARED_RANDOM.nextBoolean();
     }
     /**
      * <p>Returns the next pseudorandom, uniformly distributed float value
@@ -161,7 +161,7 @@
      * @return the random float
      */
     public float nextFloat() {
-        return (float)SHARED_RANDOM.nextDouble();
+        return SHARED_RANDOM.nextFloat();
     }
     /**
      * <p>Synonymous to the Math.random() call.</p>



Mime
View raw message