亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? random.java

?? kaffe Java 解釋器語(yǔ)言,源碼,Java的子集系統(tǒng),開放源代碼
?? JAVA
字號(hào):
/* Random.java -- a pseudo-random number generator   Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING.  If not, write to theFree Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library.  Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule.  An independent module is a module which is not derived fromor based on this library.  If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so.  If you do not wish to do so, delete thisexception statement from your version. */package java.util;import java.io.Serializable;/** * This class generates pseudorandom numbers.  It uses the same * algorithm as the original JDK-class, so that your programs behave * exactly the same way, if started with the same seed. * * The algorithm is described in <em>The Art of Computer Programming, * Volume 2</em> by Donald Knuth in Section 3.2.1.  It is a 48-bit seed, * linear congruential formula. * * If two instances of this class are created with the same seed and * the same calls to these classes are made, they behave exactly the * same way.  This should be even true for foreign implementations * (like this), so every port must use the same algorithm as described * here. * * If you want to implement your own pseudorandom algorithm, you * should extend this class and overload the <code>next()</code> and * <code>setSeed(long)</code> method.  In that case the above * paragraph doesn't apply to you. * * This class shouldn't be used for security sensitive purposes (like * generating passwords or encryption keys.  See <code>SecureRandom</code> * in package <code>java.security</code> for this purpose. * * For simple random doubles between 0.0 and 1.0, you may consider using * Math.random instead. * * @see java.security.SecureRandom * @see Math#random() * @author Jochen Hoenicke * @author Eric Blake (ebb9@email.byu.edu) * @status updated to 1.4 */public class Random implements Serializable{  /**   * True if the next nextGaussian is available.  This is used by   * nextGaussian, which generates two gaussian numbers by one call,   * and returns the second on the second call.   *   * @serial whether nextNextGaussian is available   * @see #nextGaussian()   * @see #nextNextGaussian   */  private boolean haveNextNextGaussian;  /**   * The next nextGaussian, when available.  This is used by nextGaussian,   * which generates two gaussian numbers by one call, and returns the   * second on the second call.   *   * @serial the second gaussian of a pair   * @see #nextGaussian()   * @see #haveNextNextGaussian   */  private double nextNextGaussian;  /**   * The seed.  This is the number set by setSeed and which is used   * in next.   *   * @serial the internal state of this generator   * @see #next()   */  private long seed;  /**   * Compatible with JDK 1.0+.   */  private static final long serialVersionUID = 3905348978240129619L;  /**   * Creates a new pseudorandom number generator.  The seed is initialized   * to the current time, as if by   * <code>setSeed(System.currentTimeMillis());</code>.   *   * @see System#currentTimeMillis()   */  public Random()  {    this(System.currentTimeMillis());  }  /**   * Creates a new pseudorandom number generator, starting with the   * specified seed, using <code>setSeed(seed);</code>.   *   * @param seed the initial seed   */  public Random(long seed)  {    setSeed(seed);  }  /**   * Sets the seed for this pseudorandom number generator.  As described   * above, two instances of the same random class, starting with the   * same seed, should produce the same results, if the same methods   * are called.  The implementation for java.util.Random is:   *<pre>public synchronized void setSeed(long seed){  this.seed = (seed ^ 0x5DEECE66DL) & ((1L &lt;&lt; 48) - 1);  haveNextNextGaussian = false;}</pre>   *   * @param seed the new seed   */  public synchronized void setSeed(long seed)  {    this.seed = (seed ^ 0x5DEECE66DL) & ((1L << 48) - 1);    haveNextNextGaussian = false;  }  /**   * Generates the next pseudorandom number.  This returns   * an int value whose <code>bits</code> low order bits are   * independent chosen random bits (0 and 1 are equally likely).   * The implementation for java.util.Random is:   *<pre>protected synchronized int next(int bits){  seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L &lt;&lt; 48) - 1);  return (int) (seed &gt;&gt;&gt; (48 - bits));}</pre>   *   * @param bits the number of random bits to generate, in the range 1..32   * @return the next pseudorandom value   * @since 1.1   */  protected synchronized int next(int bits)  {    seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);    return (int) (seed >>> (48 - bits));  }  /**   * Fills an array of bytes with random numbers.  All possible values   * are (approximately) equally likely.   * The JDK documentation gives no implementation, but it seems to be:   *<pre>public void nextBytes(byte[] bytes){  for (int i = 0; i &lt; bytes.length; i += 4)  {    int random = next(32);    for (int j = 0; i + j &lt; bytes.length && j &lt; 4; j++)    {      bytes[i+j] = (byte) (random & 0xff)      random &gt;&gt;= 8;    }  }}</pre>   *   * @param bytes the byte array that should be filled   * @throws NullPointerException if bytes is null   * @since 1.1   */  public void nextBytes(byte[] bytes)  {    int random;    // Do a little bit unrolling of the above algorithm.    int max = bytes.length & ~0x3;    for (int i = 0; i < max; i += 4)      {        random = next(32);        bytes[i] = (byte) random;        bytes[i + 1] = (byte) (random >> 8);        bytes[i + 2] = (byte) (random >> 16);        bytes[i + 3] = (byte) (random >> 24);      }    if (max < bytes.length)      {        random = next(32);        for (int j = max; j < bytes.length; j++)          {            bytes[j] = (byte) random;            random >>= 8;          }      }  }  /**   * Generates the next pseudorandom number.  This returns   * an int value whose 32 bits are independent chosen random bits   * (0 and 1 are equally likely).  The implementation for   * java.util.Random is:   * <pre>public int nextInt(){  return next(32);}</pre>   *   * @return the next pseudorandom value   */  public int nextInt()  {    return next(32);  }  /**   * Generates the next pseudorandom number.  This returns   * a value between 0(inclusive) and <code>n</code>(exclusive), and   * each value has the same likelihodd (1/<code>n</code>).   * (0 and 1 are equally likely).  The implementation for   * java.util.Random is:   * <pre>public int nextInt(int n){  if (n &lt;= 0)    throw new IllegalArgumentException("n must be positive");  if ((n & -n) == n)  // i.e., n is a power of 2    return (int)((n * (long) next(31)) &gt;&gt; 31);  int bits, val;  do  {    bits = next(31);    val = bits % n;  }  while(bits - val + (n-1) &lt; 0);  return val;}</pre>   *      * <p>This algorithm would return every value with exactly the same   * probability, if the next()-method would be a perfect random number   * generator.   *   * The loop at the bottom only accepts a value, if the random   * number was between 0 and the highest number less then 1<<31,   * which is divisible by n.  The probability for this is high for small   * n, and the worst case is 1/2 (for n=(1<<30)+1).   *   * The special treatment for n = power of 2, selects the high bits of   * the random number (the loop at the bottom would select the low order   * bits).  This is done, because the low order bits of linear congruential   * number generators (like the one used in this class) are known to be   * ``less random'' than the high order bits.   *   * @param n the upper bound   * @throws IllegalArgumentException if the given upper bound is negative   * @return the next pseudorandom value   * @since 1.2   */  public int nextInt(int n)  {    if (n <= 0)      throw new IllegalArgumentException("n must be positive");    if ((n & -n) == n) // i.e., n is a power of 2      return (int) ((n * (long) next(31)) >> 31);    int bits, val;    do      {        bits = next(31);        val = bits % n;      }    while (bits - val + (n - 1) < 0);    return val;  }  /**   * Generates the next pseudorandom long number.  All bits of this   * long are independently chosen and 0 and 1 have equal likelihood.   * The implementation for java.util.Random is:   *<pre>public long nextLong(){  return ((long) next(32) &lt;&lt; 32) + next(32);}</pre>   *   * @return the next pseudorandom value   */  public long nextLong()  {    return ((long) next(32) << 32) + next(32);  }  /**   * Generates the next pseudorandom boolean.  True and false have   * the same probability.  The implementation is:   * <pre>public boolean nextBoolean(){  return next(1) != 0;}</pre>   *   * @return the next pseudorandom boolean   * @since 1.2   */  public boolean nextBoolean()  {    return next(1) != 0;  }  /**   * Generates the next pseudorandom float uniformly distributed   * between 0.0f (inclusive) and 1.0f (exclusive).  The   * implementation is as follows.   * <pre>public float nextFloat(){  return next(24) / ((float)(1 &lt;&lt; 24));}</pre>   *   * @return the next pseudorandom float   */  public float nextFloat()  {    return next(24) / (float) (1 << 24);  }  /**   * Generates the next pseudorandom double uniformly distributed   * between 0.0 (inclusive) and 1.0 (exclusive).  The   * implementation is as follows.   *<pre>public double nextDouble(){  return (((long) next(26) &lt;&lt; 27) + next(27)) / (double)(1L &lt;&lt; 53);}</pre>   *   * @return the next pseudorandom double   */  public double nextDouble()  {    return (((long) next(26) << 27) + next(27)) / (double) (1L << 53);  }  /**   * Generates the next pseudorandom, Gaussian (normally) distributed   * double value, with mean 0.0 and standard deviation 1.0.   * The algorithm is as follows.   * <pre>public synchronized double nextGaussian(){  if (haveNextNextGaussian)  {    haveNextNextGaussian = false;    return nextNextGaussian;  }  else  {    double v1, v2, s;    do    {      v1 = 2 * nextDouble() - 1; // between -1.0 and 1.0      v2 = 2 * nextDouble() - 1; // between -1.0 and 1.0      s = v1 * v1 + v2 * v2;    }    while (s >= 1);    double norm = Math.sqrt(-2 * Math.log(s) / s);    nextNextGaussian = v2 * norm;    haveNextNextGaussian = true;    return v1 * norm;  }}</pre>   *   * <p>This is described in section 3.4.1 of <em>The Art of Computer   * Programming, Volume 2</em> by Donald Knuth.   *   * @return the next pseudorandom Gaussian distributed double   */  public synchronized double nextGaussian()  {    if (haveNextNextGaussian)      {        haveNextNextGaussian = false;        return nextNextGaussian;      }    double v1, v2, s;    do      {        v1 = 2 * nextDouble() - 1; // Between -1.0 and 1.0.        v2 = 2 * nextDouble() - 1; // Between -1.0 and 1.0.        s = v1 * v1 + v2 * v2;      }    while (s >= 1);    double norm = Math.sqrt(-2 * Math.log(s) / s);    nextNextGaussian = v2 * norm;    haveNextNextGaussian = true;    return v1 * norm;  }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情文学综合丁香| 欧美午夜精品久久久| 国产一区中文字幕| 麻豆91免费看| 六月丁香综合在线视频| 久久国产综合精品| 久久国产精品99久久久久久老狼 | 天堂影院一区二区| 成人午夜看片网址| 不卡电影免费在线播放一区| 成人中文字幕合集| 99精品久久免费看蜜臀剧情介绍| 国产成人午夜99999| 日韩国产精品大片| 精品在线播放午夜| 国产成人av一区二区三区在线 | 欧美日韩国产综合草草| 91丨九色丨蝌蚪丨老版| 日本精品视频一区二区三区| 欧美日韩精品一区二区天天拍小说 | 日韩av电影免费观看高清完整版| 水蜜桃久久夜色精品一区的特点 | 91久久奴性调教| 欧美久久久久免费| 欧美成人一区二区三区片免费| 久久综合中文字幕| 中文字幕亚洲成人| 亚洲电影你懂得| 免费不卡在线观看| 国产69精品久久99不卡| 99久久国产综合精品麻豆| 欧美三区在线视频| 精品国产一区二区三区久久久蜜月 | 中文幕一区二区三区久久蜜桃| 亚洲欧美日韩小说| 天天操天天色综合| 国产成人精品亚洲午夜麻豆| 91性感美女视频| 91麻豆精品国产自产在线观看一区| 精品国产免费视频| 亚洲精品国久久99热| 日韩电影在线免费看| 国产不卡免费视频| 欧美日韩亚洲综合| 久久久精品免费免费| 亚洲欧美另类在线| 精品在线视频一区| 在线观看免费亚洲| 久久久精品影视| 亚洲午夜电影网| 国产高清不卡一区二区| 欧美在线短视频| 蓝色福利精品导航| 97精品久久久久中文字幕| 欧美一激情一区二区三区| 1区2区3区欧美| 毛片基地黄久久久久久天堂| 99久久国产免费看| 日韩视频一区在线观看| 日韩理论电影院| 国产精品综合av一区二区国产馆| 日本高清不卡一区| 久久精品一区二区三区四区| 亚洲国产一区二区在线播放| 粉嫩高潮美女一区二区三区| 欧美美女bb生活片| 亚洲三级在线看| 国产精品主播直播| 欧美一卡在线观看| 悠悠色在线精品| 国产**成人网毛片九色| 这里只有精品免费| 亚洲综合一区在线| 成人99免费视频| 国产亚洲va综合人人澡精品| 青娱乐精品在线视频| 在线亚洲高清视频| 亚洲图片欧美激情| 成人网在线播放| 久久精品亚洲精品国产欧美| 美女尤物国产一区| 777欧美精品| 亚洲一区二区三区自拍| 一本一本久久a久久精品综合麻豆| 2017欧美狠狠色| 看电视剧不卡顿的网站| 欧美精品三级日韩久久| 亚洲一区中文日韩| 色88888久久久久久影院按摩 | 韩国欧美国产1区| 日韩一级完整毛片| 日韩高清一区二区| 欧美情侣在线播放| 亚洲成人免费在线观看| 欧美艳星brazzers| 亚洲一区二区三区国产| 色综合天天天天做夜夜夜夜做| 国产精品每日更新在线播放网址| 国产精品亚洲人在线观看| 精品成a人在线观看| 黑人巨大精品欧美黑白配亚洲| 日韩欧美国产系列| 久久国产综合精品| 久久网站最新地址| 国产成人欧美日韩在线电影| 久久久久国产精品厨房| 国产精品系列在线播放| 欧美国产一区二区在线观看| 国产精品一区二区免费不卡| 久久久久久综合| 高清不卡在线观看av| 国产精品每日更新在线播放网址| 国产mv日韩mv欧美| 日韩美女视频19| 欧美在线综合视频| 日韩精品欧美精品| 精品日本一线二线三线不卡| 国产永久精品大片wwwapp| 欧美国产精品中文字幕| av中文字幕不卡| 一区二区三区产品免费精品久久75| 91黄色激情网站| 日韩精品福利网| www国产成人免费观看视频 深夜成人网| 国产麻豆精品在线| 亚洲欧美日韩久久精品| 欧美日韩一级二级| 精彩视频一区二区三区| 亚洲国产高清不卡| 欧美在线播放高清精品| 久久精品国产77777蜜臀| 国产欧美一区二区三区在线看蜜臀 | 欧美日本一区二区在线观看| 免费看欧美美女黄的网站| 久久婷婷成人综合色| 床上的激情91.| 亚洲亚洲人成综合网络| 日韩免费观看2025年上映的电影| 国产高清无密码一区二区三区| 国产精品免费久久| 欧美日韩精品欧美日韩精品一综合| 美女尤物国产一区| 中文字幕在线不卡视频| 欧美日韩www| 成人小视频免费观看| 亚洲国产精品一区二区久久 | 欧美一级日韩免费不卡| 国产风韵犹存在线视精品| 亚洲一区二区在线免费看| 精品久久久久久久久久久久久久久 | 欧美久久婷婷综合色| 国产一区久久久| 亚洲精品ww久久久久久p站| 91精品免费观看| 99久久伊人网影院| 蜜桃视频一区二区三区在线观看| 国产精品妹子av| 日韩一区二区在线观看视频 | 成人av在线网| 日日夜夜一区二区| 国产精品欧美一级免费| 91精品国产综合久久久蜜臀图片| 波多野结衣亚洲| 奇米精品一区二区三区在线观看一 | 亚洲欧美一区二区三区孕妇| 欧美videofree性高清杂交| 在线亚洲高清视频| 成人午夜大片免费观看| 日本午夜一本久久久综合| 亚洲欧洲av在线| 久久一区二区视频| 欧美浪妇xxxx高跟鞋交| 91网站最新网址| 国产剧情在线观看一区二区| 污片在线观看一区二区| 自拍视频在线观看一区二区| 久久美女艺术照精彩视频福利播放| 欧美精品粉嫩高潮一区二区| 91在线精品一区二区| 国产盗摄视频一区二区三区| 麻豆精品久久久| 亚洲成人午夜影院| 一区二区三区在线免费播放| 亚洲国产精品国自产拍av| 日韩精品一区国产麻豆| 欧美日韩另类一区| 日本高清不卡视频| 97成人超碰视| 成人动漫在线一区| 国产伦精品一区二区三区在线观看| 日韩精品免费视频人成| 亚洲成人激情综合网| 一区二区三区鲁丝不卡| 国产精品久久久久国产精品日日| 亚洲精品在线一区二区| 日韩欧美中文字幕制服| 88在线观看91蜜桃国自产| 欧美日韩免费在线视频| 在线观看日韩电影| 在线亚洲一区观看|