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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? biginteger.java

?? java源代碼 請看看啊 提點寶貴的意見
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/* * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. *//* * @(#)BigInteger.java	1.55 03/01/29 */package java.math;import java.util.Random;import java.io.*;/** * Immutable arbitrary-precision integers.  All operations behave as if * BigIntegers were represented in two's-complement notation (like Java's * primitive integer types).  BigInteger provides analogues to all of Java's * primitive integer operators, and all relevant methods from java.lang.Math. * Additionally, BigInteger provides operations for modular arithmetic, GCD * calculation, primality testing, prime generation, bit manipulation, * and a few other miscellaneous operations. * <p> * Semantics of arithmetic operations exactly mimic those of Java's integer * arithmetic operators, as defined in <i>The Java Language Specification</i>. * For example, division by zero throws an <tt>ArithmeticException</tt>, and * division of a negative by a positive yields a negative (or zero) remainder. * All of the details in the Spec concerning overflow are ignored, as * BigIntegers are made as large as necessary to accommodate the results of an * operation. * <p> * Semantics of shift operations extend those of Java's shift operators * to allow for negative shift distances.  A right-shift with a negative * shift distance results in a left shift, and vice-versa.  The unsigned * right shift operator (&gt;&gt;&gt;) is omitted, as this operation makes * little sense in combination with the "infinite word size" abstraction * provided by this class. * <p> * Semantics of bitwise logical operations exactly mimic those of Java's * bitwise integer operators.  The binary operators (<tt>and</tt>, * <tt>or</tt>, <tt>xor</tt>) implicitly perform sign extension on the shorter * of the two operands prior to performing the operation. * <p> * Comparison operations perform signed integer comparisons, analogous to * those performed by Java's relational and equality operators. * <p> * Modular arithmetic operations are provided to compute residues, perform * exponentiation, and compute multiplicative inverses.  These methods always * return a non-negative result, between <tt>0</tt> and <tt>(modulus - 1)</tt>, * inclusive. * <p> * Bit operations operate on a single bit of the two's-complement * representation of their operand.  If necessary, the operand is sign- * extended so that it contains the designated bit.  None of the single-bit * operations can produce a BigInteger with a different sign from the * BigInteger being operated on, as they affect only a single bit, and the * "infinite word size" abstraction provided by this class ensures that there * are infinitely many "virtual sign bits" preceding each BigInteger. * <p> * For the sake of brevity and clarity, pseudo-code is used throughout the * descriptions of BigInteger methods.  The pseudo-code expression * <tt>(i + j)</tt> is shorthand for "a BigInteger whose value is * that of the BigInteger <tt>i</tt> plus that of the BigInteger <tt>j</tt>." * The pseudo-code expression <tt>(i == j)</tt> is shorthand for * "<tt>true</tt> if and only if the BigInteger <tt>i</tt> represents the same * value as the the BigInteger <tt>j</tt>."  Other pseudo-code expressions are * interpreted similarly. * <p> * All methods and constructors in this class throw * <CODE>NullPointerException</CODE> when passed * a null object reference for any input parameter. * * @see     BigDecimal * @version 1.55, 01/29/03 * @author  Josh Bloch * @author  Michael McCloskey * @since JDK1.1 */public class BigInteger extends Number implements Comparable {    /**     * The signum of this BigInteger: -1 for negative, 0 for zero, or     * 1 for positive.  Note that the BigInteger zero <i>must</i> have     * a signum of 0.  This is necessary to ensures that there is exactly one     * representation for each BigInteger value.     *     * @serial     */    int signum;    /**     * The magnitude of this BigInteger, in <i>big-endian</i> order: the     * zeroth element of this array is the most-significant int of the     * magnitude.  The magnitude must be "minimal" in that the most-significant     * int (<tt>mag[0]</tt>) must be non-zero.  This is necessary to     * ensure that there is exactly one representation for each BigInteger     * value.  Note that this implies that the BigInteger zero has a     * zero-length mag array.     */    int[] mag;    // These "redundant fields" are initialized with recognizable nonsense    // values, and cached the first time they are needed (or never, if they    // aren't needed).    /**     * The bitCount of this BigInteger, as returned by bitCount(), or -1     * (either value is acceptable).     *     * @serial     * @see #bitCount     */    private int bitCount =  -1;    /**     * The bitLength of this BigInteger, as returned by bitLength(), or -1     * (either value is acceptable).     *     * @serial     * @see #bitLength     */    private int bitLength = -1;    /**     * The lowest set bit of this BigInteger, as returned by getLowestSetBit(),     * or -2 (either value is acceptable).     *     * @serial     * @see #getLowestSetBit     */    private int lowestSetBit = -2;    /**     * The index of the lowest-order byte in the magnitude of this BigInteger     * that contains a nonzero byte, or -2 (either value is acceptable).  The     * least significant byte has int-number 0, the next byte in order of     * increasing significance has byte-number 1, and so forth.     *     * @serial     */    private int firstNonzeroByteNum = -2;    /**     * The index of the lowest-order int in the magnitude of this BigInteger     * that contains a nonzero int, or -2 (either value is acceptable).  The     * least significant int has int-number 0, the next int in order of     * increasing significance has int-number 1, and so forth.     */    private int firstNonzeroIntNum = -2;    /**     * This mask is used to obtain the value of an int as if it were unsigned.     */    private final static long LONG_MASK = 0xffffffffL;    //Constructors    /**     * Translates a byte array containing the two's-complement binary     * representation of a BigInteger into a BigInteger.  The input array is     * assumed to be in <i>big-endian</i> byte-order: the most significant     * byte is in the zeroth element.     *     * @param  val big-endian two's-complement binary representation of     *	       BigInteger.     * @throws NumberFormatException <tt>val</tt> is zero bytes long.     */    public BigInteger(byte[] val) {	if (val.length == 0)	    throw new NumberFormatException("Zero length BigInteger");	if (val[0] < 0) {            mag = makePositive(val);	    signum = -1;	} else {	    mag = stripLeadingZeroBytes(val);	    signum = (mag.length == 0 ? 0 : 1);	}    }    /**     * This private constructor translates an int array containing the     * two's-complement binary representation of a BigInteger into a     * BigInteger. The input array is assumed to be in <i>big-endian</i>     * int-order: the most significant int is in the zeroth element.     */    private BigInteger(int[] val) {	if (val.length == 0)	    throw new NumberFormatException("Zero length BigInteger");	if (val[0] < 0) {            mag = makePositive(val);	    signum = -1;	} else {	    mag = trustedStripLeadingZeroInts(val);	    signum = (mag.length == 0 ? 0 : 1);	}    }    /**     * Translates the sign-magnitude representation of a BigInteger into a     * BigInteger.  The sign is represented as an integer signum value: -1 for     * negative, 0 for zero, or 1 for positive.  The magnitude is a byte array     * in <i>big-endian</i> byte-order: the most significant byte is in the     * zeroth element.  A zero-length magnitude array is permissible, and will     * result in in a BigInteger value of 0, whether signum is -1, 0 or 1.     *     * @param  signum signum of the number (-1 for negative, 0 for zero, 1     * 	       for positive).     * @param  magnitude big-endian binary representation of the magnitude of     * 	       the number.     * @throws NumberFormatException <tt>signum</tt> is not one of the three     *	       legal values (-1, 0, and 1), or <tt>signum</tt> is 0 and     *	       <tt>magnitude</tt> contains one or more non-zero bytes.     */    public BigInteger(int signum, byte[] magnitude) {	this.mag = stripLeadingZeroBytes(magnitude);	if (signum < -1 || signum > 1)	    throw(new NumberFormatException("Invalid signum value"));	if (this.mag.length==0) {	    this.signum = 0;	} else {	    if (signum == 0)		throw(new NumberFormatException("signum-magnitude mismatch"));	    this.signum = signum;	}    }    /**     * A constructor for internal use that translates the sign-magnitude     * representation of a BigInteger into a BigInteger. It checks the     * arguments and copies the magnitude so this constructor would be     * safe for external use.     */    private BigInteger(int signum, int[] magnitude) {	this.mag = stripLeadingZeroInts(magnitude);	if (signum < -1 || signum > 1)	    throw(new NumberFormatException("Invalid signum value"));	if (this.mag.length==0) {	    this.signum = 0;	} else {	    if (signum == 0)		throw(new NumberFormatException("signum-magnitude mismatch"));	    this.signum = signum;	}    }    /**     * Translates the String representation of a BigInteger in the specified     * radix into a BigInteger.  The String representation consists of an     * optional minus sign followed by a sequence of one or more digits in the     * specified radix.  The character-to-digit mapping is provided by     * <tt>Character.digit</tt>.  The String may not contain any extraneous     * characters (whitespace, for example).     *     * @param val String representation of BigInteger.     * @param radix radix to be used in interpreting <tt>val</tt>.     * @throws NumberFormatException <tt>val</tt> is not a valid representation     *	       of a BigInteger in the specified radix, or <tt>radix</tt> is     *	       outside the range from {@link Character#MIN_RADIX} to     *	       {@link Character#MAX_RADIX}, inclusive.     * @see    Character#digit     */    public BigInteger(String val, int radix) {	int cursor = 0, numDigits;        int len = val.length();	if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)	    throw new NumberFormatException("Radix out of range");	if (val.length() == 0)	    throw new NumberFormatException("Zero length BigInteger");	// Check for minus sign	signum = 1;        int index = val.indexOf('-');        if (index != -1) {            if (index == 0) {                if (val.length() == 1)                    throw new NumberFormatException("Zero length BigInteger");                signum = -1;                cursor = 1;            } else {                throw new NumberFormatException("Illegal embedded minus sign");            }        }        // Skip leading zeros and compute number of digits in magnitude	while (cursor < len &&               Character.digit(val.charAt(cursor),radix) == 0)	    cursor++;	if (cursor == len) {	    signum = 0;	    mag = ZERO.mag;	    return;	} else {	    numDigits = len - cursor;	}        // Pre-allocate array of expected size. May be too large but can        // never be too small. Typically exact.        int numBits = (int)(((numDigits * bitsPerDigit[radix]) >>> 10) + 1);        int numWords = (numBits + 31) /32;        mag = new int[numWords];	// Process first (potentially short) digit group	int firstGroupLen = numDigits % digitsPerInt[radix];	if (firstGroupLen == 0)	    firstGroupLen = digitsPerInt[radix];	String group = val.substring(cursor, cursor += firstGroupLen);        mag[mag.length - 1] = Integer.parseInt(group, radix);	if (mag[mag.length - 1] < 0)	    throw new NumberFormatException("Illegal digit");        	// Process remaining digit groups        int superRadix = intRadix[radix];        int groupVal = 0;	while (cursor < val.length()) {	    group = val.substring(cursor, cursor += digitsPerInt[radix]);	    groupVal = Integer.parseInt(group, radix);	    if (groupVal < 0)		throw new NumberFormatException("Illegal digit");            destructiveMulAdd(mag, superRadix, groupVal);	}        // Required for cases where the array was overallocated.        mag = trustedStripLeadingZeroInts(mag);    }    // Constructs a new BigInteger using a char array with radix=10    BigInteger(char[] val) {        int cursor = 0, numDigits;        int len = val.length;	// Check for leading minus sign	signum = 1;	if (val[0] == '-') {	    if (len == 1)		throw new NumberFormatException("Zero length BigInteger");	    signum = -1;	    cursor = 1;	}        // Skip leading zeros and compute number of digits in magnitude	while (cursor < len && Character.digit(val[cursor], 10) == 0)	    cursor++;	if (cursor == len) {	    signum = 0;	    mag = ZERO.mag;	    return;	} else {	    numDigits = len - cursor;	}        // Pre-allocate array of expected size        int numWords;        if (len < 10) {            numWords = 1;        } else {                int numBits = (int)(((numDigits * bitsPerDigit[10]) >>> 10) + 1);            numWords = (numBits + 31) /32;        }        mag = new int[numWords]; 	// Process first (potentially short) digit group	int firstGroupLen = numDigits % digitsPerInt[10];	if (firstGroupLen == 0)	    firstGroupLen = digitsPerInt[10];        mag[mag.length-1] = parseInt(val, cursor,  cursor += firstGroupLen);        	// Process remaining digit groups	while (cursor < len) {	    int groupVal = parseInt(val, cursor, cursor += digitsPerInt[10]);            destructiveMulAdd(mag, intRadix[10], groupVal);	}        mag = trustedStripLeadingZeroInts(mag);    }    // Create an integer with the digits between the two indexes    // Assumes start < end. The result may be negative, but it    // is to be treated as an unsigned value.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美吻胸吃奶大尺度电影| 国产老妇另类xxxxx| 亚洲女同女同女同女同女同69| 久久免费看少妇高潮| 精品美女在线播放| 久久人人爽人人爽| 国产午夜亚洲精品理论片色戒| 久久蜜桃av一区精品变态类天堂| 久久综合九色综合欧美98| 久久精品人人爽人人爽| 国产精品久久久久婷婷二区次| 国产日韩欧美精品在线| 亚洲三级视频在线观看| 中文字幕一区二区三区四区 | 亚洲欧美日韩在线不卡| 亚洲精品免费看| 五月天激情综合网| 日本不卡123| 国产成人精品影视| av午夜精品一区二区三区| 欧美在线观看一二区| 日韩欧美亚洲国产另类| 国产欧美一区二区三区鸳鸯浴 | 久久久影视传媒| 中文字幕在线观看不卡视频| 亚洲伊人色欲综合网| 久久精品国产秦先生| 国产91在线观看| 欧美日韩一区二区三区免费看| 日韩网站在线看片你懂的| 亚洲国产成人一区二区三区| 夜夜嗨av一区二区三区中文字幕| 亚洲电影在线免费观看| 国产麻豆日韩欧美久久| 91麻豆免费观看| 欧美成人精品1314www| 成人免费在线视频| 麻豆国产欧美一区二区三区| 99国产欧美久久久精品| 日韩欧美国产系列| 18欧美亚洲精品| 久久电影国产免费久久电影| 日本精品一级二级| 久久这里只有精品6| 午夜伊人狠狠久久| 不卡免费追剧大全电视剧网站| 欧美高清你懂得| 日韩一区中文字幕| 国产福利一区二区| 欧美www视频| 日本成人中文字幕在线视频 | 天天影视涩香欲综合网| 不卡欧美aaaaa| xfplay精品久久| 日一区二区三区| 91成人免费在线| 日韩一区欧美小说| 福利一区福利二区| 久久综合久久99| 六月丁香婷婷色狠狠久久| 欧美性大战久久久久久久蜜臀| **欧美大码日韩| 成人丝袜18视频在线观看| 久久夜色精品一区| 美女在线观看视频一区二区| 在线不卡免费欧美| 午夜欧美在线一二页| 91久久精品日日躁夜夜躁欧美| 国产清纯白嫩初高生在线观看91 | 久久亚洲综合av| 日本美女视频一区二区| 91麻豆精品国产91久久久久 | ●精品国产综合乱码久久久久| 国产精品一区久久久久| 久久久久久久综合狠狠综合| 国内精品自线一区二区三区视频| 欧美一区二区播放| 极品美女销魂一区二区三区免费| 精品国内片67194| 国产精品1024久久| 中文字幕一区二区三区四区| 92精品国产成人观看免费| 亚洲老妇xxxxxx| 欧美日韩在线三区| 美女www一区二区| 欧美成人在线直播| 老司机精品视频导航| 色噜噜久久综合| 欧美成人午夜电影| 成人性生交大片免费看中文网站| 99久久国产免费看| 综合自拍亚洲综合图不卡区| 成人综合在线视频| 亚洲一区自拍偷拍| 777色狠狠一区二区三区| 久久9热精品视频| 国产精品久线在线观看| 欧美性生活大片视频| 精品一区二区日韩| 亚洲天堂av一区| 欧美一区二区在线看| 国产成人免费网站| 亚洲一区视频在线观看视频| 欧美一卡二卡在线| jlzzjlzz亚洲日本少妇| 亚洲成人免费看| 中文字幕不卡在线播放| 欧美日韩免费视频| 国产成人精品三级麻豆| 亚洲福利视频一区| 国产欧美日韩不卡| 欧美日韩dvd在线观看| 国产美女一区二区| 午夜精品爽啪视频| 国产精品毛片久久久久久久| 欧美狂野另类xxxxoooo| 成人性生交大片免费看中文| 日韩国产精品大片| 亚洲少妇屁股交4| 久久久久久久久久久黄色| 日本电影亚洲天堂一区| 国产综合久久久久影院| 亚洲成人www| 亚洲视频一二三| 国产亚洲一二三区| 7777精品伊人久久久大香线蕉经典版下载 | 精品午夜一区二区三区在线观看| 亚洲三级视频在线观看| 国产欧美1区2区3区| 精品久久久久av影院| 91精品国产色综合久久不卡电影| 9l国产精品久久久久麻豆| 老司机精品视频线观看86| 香蕉成人伊视频在线观看| 伊人开心综合网| 国产精品成人一区二区艾草| 国产午夜亚洲精品午夜鲁丝片| 日韩欧美国产一二三区| 欧美日韩高清一区二区不卡| 在线观看成人小视频| www.爱久久.com| 国产高清不卡二三区| 高清日韩电视剧大全免费| 精品一区二区综合| 麻豆精品一区二区| 免费成人结看片| 日本不卡123| 美女视频网站黄色亚洲| 麻豆精品视频在线观看视频| 免费不卡在线视频| 精品一区二区成人精品| 麻豆精品视频在线观看| 激情综合网激情| 激情欧美日韩一区二区| 狠狠色2019综合网| 国产在线精品不卡| 国产成人精品影视| 99热99精品| 91首页免费视频| 在线精品视频一区二区| 欧美日韩在线播放三区| 91麻豆精品国产91久久久更新时间| 欧美精品日韩一区| 日韩精品一区二区在线| 日韩美女一区二区三区四区| 欧美mv日韩mv国产网站| 国产欧美综合在线观看第十页| 国产欧美一区二区精品性色超碰| 国产精品美女久久福利网站| 亚洲欧美视频在线观看视频| 亚洲成av人在线观看| 日韩av不卡一区二区| 国产麻豆欧美日韩一区| 成人一区二区在线观看| 97成人超碰视| 欧美精品一二三| 久久久噜噜噜久久人人看 | 亚洲影院在线观看| 免费精品视频在线| www.欧美精品一二区| 欧美伊人久久久久久久久影院 | 亚洲欧美偷拍另类a∨色屁股| 亚洲午夜久久久久中文字幕久| 亚洲h动漫在线| 国产老妇另类xxxxx| 欧美怡红院视频| 日本一区二区视频在线| 亚洲va欧美va人人爽| 国产乱码精品一区二区三 | 国产一区在线不卡| 91香蕉视频在线| 精品国产乱码久久久久久浪潮| 亚洲欧美一区二区在线观看| 亚洲超碰精品一区二区| 福利一区在线观看| 日韩欧美一级在线播放| 一区二区三区久久| 国产精品123| 欧美一区二区日韩| 亚洲九九爱视频|