[cvs] / jsr166 / src / main / java / util / SplittableRandom.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/SplittableRandom.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.35, Sun Nov 13 02:23:22 2016 UTC revision 1.36, Sun Nov 13 03:36:50 2016 UTC
# Line 532  Line 532 
532    
533      /**      /**
534       * Generates a pseudorandom number with the indicated number of       * Generates a pseudorandom number with the indicated number of
535       * bits. Unlike in superclass {@link Random}, this method is never       * low-order bits.  Because this class has no subclasses, this
536       * internally called or used by any other publicly accessible       * method cannot be invoked or overridden.
      * method.  
537       *       *
538       * @param  bits random bits       * @param  bits random bits
539       * @return the next pseudorandom value from this random number       * @return the next pseudorandom value from this random number
540       *         generator's sequence       *         generator's sequence
541       */       */
542      protected int next(int bits) {      protected int next(int bits) {
543          return (int)(nextLong() >>> (64 - bits));          return nextInt() >>> (32 - bits);
544      }      }
545    
546      /**      /**

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8