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

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

?? mutablebiginteger.java

?? java源代碼 請看看啊 提點寶貴的意見
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. *//* * @(#)MutableBigInteger.java	1.9 03/01/23 */package java.math;/** * A class used to represent multiprecision integers that makes efficient * use of allocated space by allowing a number to occupy only part of * an array so that the arrays do not have to be reallocated as often. * When performing an operation with many iterations the array used to * hold a number is only reallocated when necessary and does not have to * be the same size as the number it represents. A mutable number allows * calculations to occur on the same number without having to create * a new number for every step of the calculation as occurs with * BigIntegers. * * @see     BigInteger * @version 1.9, 01/23/03 * @author  Michael McCloskey * @since   1.3 */class MutableBigInteger {    /**     * Holds the magnitude of this MutableBigInteger in big endian order.     * The magnitude may start at an offset into the value array, and it may     * end before the length of the value array.     */    int[] value;    /**     * The number of ints of the value array that are currently used     * to hold the magnitude of this MutableBigInteger. The magnitude starts     * at an offset and offset + intLen may be less than value.length.     */    int intLen;    /**     * The offset into the value array where the magnitude of this     * MutableBigInteger begins.     */    int offset = 0;    /**     * This mask is used to obtain the value of an int as if it were unsigned.     */    private final static long LONG_MASK = 0xffffffffL;    // Constructors    /**     * The default constructor. An empty MutableBigInteger is created with     * a one word capacity.     */    MutableBigInteger() {        value = new int[1];        intLen = 0;    }    /**     * Construct a new MutableBigInteger with a magnitude specified by     * the int val.     */    MutableBigInteger(int val) {        value = new int[1];        intLen = 1;        value[0] = val;    }    /**     * Construct a new MutableBigInteger with the specified value array     * up to the specified length.     */    MutableBigInteger(int[] val, int len) {        value = val;        intLen = len;    }    /**     * Construct a new MutableBigInteger with the specified value array     * up to the length of the array supplied.     */    MutableBigInteger(int[] val) {        value = val;        intLen = val.length;    }    /**     * Construct a new MutableBigInteger with a magnitude equal to the     * specified BigInteger.     */    MutableBigInteger(BigInteger b) {        value = (int[]) b.mag.clone();        intLen = value.length;    }    /**     * Construct a new MutableBigInteger with a magnitude equal to the     * specified MutableBigInteger.     */    MutableBigInteger(MutableBigInteger val) {        intLen = val.intLen;        value = new int[intLen];        for(int i=0; i<intLen; i++)            value[i] = val.value[val.offset+i];    }    /**     * Clear out a MutableBigInteger for reuse.     */    void clear() {        offset = intLen = 0;        for (int index=0, n=value.length; index < n; index++)            value[index] = 0;    }    /**     * Set a MutableBigInteger to zero, removing its offset.     */    void reset() {        offset = intLen = 0;    }    /**     * Compare the magnitude of two MutableBigIntegers. Returns -1, 0 or 1     * as this MutableBigInteger is numerically less than, equal to, or     * greater than <tt>b</tt>.      */    final int compare(MutableBigInteger b) {        if (intLen < b.intLen)            return -1;        if (intLen > b.intLen)            return 1;        for (int i=0; i<intLen; i++) {            int b1 = value[offset+i]     + 0x80000000;            int b2 = b.value[b.offset+i] + 0x80000000;            if (b1 < b2)                return -1;            if (b1 > b2)                return 1;        }        return 0;    }    /**     * Return the index of the lowest set bit in this MutableBigInteger. If the     * magnitude of this MutableBigInteger is zero, -1 is returned.     */    private final int getLowestSetBit() {        if (intLen == 0)            return -1;        int j, b;        for (j=intLen-1; (j>0) && (value[j+offset]==0); j--)            ;        b = value[j+offset];        if (b==0)             return -1;        return ((intLen-1-j)<<5) + BigInteger.trailingZeroCnt(b);    }    /**     * Return the int in use in this MutableBigInteger at the specified     * index. This method is not used because it is not inlined on all     * platforms.     */    private final int getInt(int index) {        return value[offset+index];    }    /**     * Return a long which is equal to the unsigned value of the int in     * use in this MutableBigInteger at the specified index. This method is     * not used because it is not inlined on all platforms.     */    private final long getLong(int index) {        return value[offset+index] & LONG_MASK;    }    /**     * Ensure that the MutableBigInteger is in normal form, specifically     * making sure that there are no leading zeros, and that if the     * magnitude is zero, then intLen is zero.     */    final void normalize() {        if (intLen == 0) {            offset = 0;            return;        }        int index = offset;        if (value[index] != 0)            return;        int indexBound = index+intLen;        do {            index++;        } while(index < indexBound && value[index]==0);        int numZeros = index - offset;        intLen -= numZeros;        offset = (intLen==0 ?  0 : offset+numZeros);    }    /**     * If this MutableBigInteger cannot hold len words, increase the size     * of the value array to len words.     */    private final void ensureCapacity(int len) {        if (value.length < len) {            value = new int[len];            offset = 0;            intLen = len;        }    }    /**     * Convert this MutableBigInteger into an int array with no leading     * zeros, of a length that is equal to this MutableBigInteger's intLen.     */    int[] toIntArray() {        int[] result = new int[intLen];        for(int i=0; i<intLen; i++)            result[i] = value[offset+i];        return result;    }    /**     * Sets the int at index+offset in this MutableBigInteger to val.     * This does not get inlined on all platforms so it is not used     * as often as originally intended.     */    void setInt(int index, int val) {        value[offset + index] = val;    }    /**     * Sets this MutableBigInteger's value array to the specified array.     * The intLen is set to the specified length.     */    void setValue(int[] val, int length) {        value = val;        intLen = length;        offset = 0;    }    /**     * Sets this MutableBigInteger's value array to a copy of the specified     * array. The intLen is set to the length of the new array.     */    void copyValue(MutableBigInteger val) {        int len = val.intLen;        if (value.length < len)            value = new int[len];        for(int i=0; i<len; i++)            value[i] = val.value[val.offset+i];        intLen = len;        offset = 0;    }    /**     * Sets this MutableBigInteger's value array to a copy of the specified     * array. The intLen is set to the length of the specified array.     */    void copyValue(int[] val) {        int len = val.length;        if (value.length < len)            value = new int[len];        for(int i=0; i<len; i++)            value[i] = val[i];        intLen = len;        offset = 0;    }    /**     * Returns true iff this MutableBigInteger has a value of one.     */    boolean isOne() {        return (intLen == 1) && (value[offset] == 1);    }    /**     * Returns true iff this MutableBigInteger has a value of zero.     */    boolean isZero() {        return (intLen == 0);    }    /**     * Returns true iff this MutableBigInteger is even.     */    boolean isEven() {        return (intLen == 0) || ((value[offset + intLen - 1] & 1) == 0);    }    /**     * Returns true iff this MutableBigInteger is odd.     */    boolean isOdd() {        return ((value[offset + intLen - 1] & 1) == 1);    }    /**     * Returns true iff this MutableBigInteger is in normal form. A     * MutableBigInteger is in normal form if it has no leading zeros     * after the offset, and intLen + offset <= value.length.     */    boolean isNormal() {        if (intLen + offset > value.length)            return false;        if (intLen ==0)            return true;        return (value[offset] != 0);    }    /**     * Returns a String representation of this MutableBigInteger in radix 10.     */    public String toString() {        BigInteger b = new BigInteger(this, 1);        return b.toString();    }    /**     * Right shift this MutableBigInteger n bits. The MutableBigInteger is left     * in normal form.     */    void rightShift(int n) {        if (intLen == 0)            return;        int nInts = n >>> 5;        int nBits = n & 0x1F;        this.intLen -= nInts;        if (nBits == 0)            return;        int bitsInHighWord = BigInteger.bitLen(value[offset]);        if (nBits >= bitsInHighWord) {            this.primitiveLeftShift(32 - nBits);            this.intLen--;        } else {            primitiveRightShift(nBits);        }    }    /**     * Left shift this MutableBigInteger n bits.      */    void leftShift(int n) {        /*         * If there is enough storage space in this MutableBigInteger already         * the available space will be used. Space to the right of the used         * ints in the value array is faster to utilize, so the extra space         * will be taken from the right if possible.         */        if (intLen == 0)           return;        int nInts = n >>> 5;        int nBits = n&0x1F;        int bitsInHighWord = BigInteger.bitLen(value[offset]);                // If shift can be done without moving words, do so        if (n <= (32-bitsInHighWord)) {            primitiveLeftShift(nBits);            return;        }        int newLen = intLen + nInts +1;        if (nBits <= (32-bitsInHighWord))            newLen--;        if (value.length < newLen) {            // The array must grow            int[] result = new int[newLen];            for (int i=0; i<intLen; i++)                result[i] = value[offset+i];            setValue(result, newLen);        } else if (value.length - offset >= newLen) {            // Use space on right            for(int i=0; i<newLen - intLen; i++)                value[offset+intLen+i] = 0;        } else {            // Must use space on left            for (int i=0; i<intLen; i++)                value[i] = value[offset+i];            for (int i=intLen; i<newLen; i++)                value[i] = 0;            offset = 0;        }        intLen = newLen;        if (nBits == 0)            return;        if (nBits <= (32-bitsInHighWord))            primitiveLeftShift(nBits);        else            primitiveRightShift(32 -nBits);    }    /**     * A primitive used for division. This method adds in one multiple of the     * divisor a back to the dividend result at a specified offset. It is used     * when qhat was estimated too large, and must be adjusted.     */    private int divadd(int[] a, int[] result, int offset) {        long carry = 0;        for (int j=a.length-1; j >= 0; j--) {            long sum = (a[j] & LONG_MASK) +                        (result[j+offset] & LONG_MASK) + carry;            result[j+offset] = (int)sum;            carry = sum >>> 32;        }        return (int)carry;    }    /**     * This method is used for division. It multiplies an n word input a by one     * word input x, and subtracts the n word product from q. This is needed     * when subtracting qhat*divisor from dividend.     */    private int mulsub(int[] q, int[] a, int x, int len, int offset) {        long xLong = x & LONG_MASK;        long carry = 0;        offset += len;        for (int j=len-1; j >= 0; j--) {            long product = (a[j] & LONG_MASK) * xLong + carry;            long difference = q[offset] - product;            q[offset--] = (int)difference;            carry = (product >>> 32)                     + (((difference & LONG_MASK) >                         (((~(int)product) & LONG_MASK))) ? 1:0);        }        return (int)carry;    }    /**     * Right shift this MutableBigInteger n bits, where n is     * less than 32.     * Assumes that intLen > 0, n > 0 for speed     */    private final void primitiveRightShift(int n) {        int[] val = value;        int n2 = 32 - n;        for (int i=offset+intLen-1, c=val[i]; i>offset; i--) {            int b = c;            c = val[i-1];

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产成人精品| 国产精品美女久久久久av爽李琼| 国产精品久久久久一区二区三区| 99久久精品国产导航| 尤物av一区二区| 日韩欧美激情在线| www.日韩在线| 亚洲日本丝袜连裤袜办公室| 欧美性大战xxxxx久久久| 久草这里只有精品视频| 国产精品国产三级国产普通话蜜臀| 欧美综合色免费| 国产一区二区精品久久| 欧美激情综合五月色丁香| 欧美日韩视频不卡| 丁香六月久久综合狠狠色| 午夜精品福利一区二区蜜股av| 国产日韩一级二级三级| 欧美日韩一区高清| 成人免费高清视频在线观看| 日韩在线观看一区二区| 国产精品久久久久久久久晋中 | 99久久精品情趣| 日韩电影在线观看一区| 2024国产精品| 欧美精品一级二级| eeuss鲁片一区二区三区在线看| 亚洲激情图片一区| 国产日韩欧美精品在线| 欧美日韩视频不卡| 91麻豆精品秘密| 国产黄色精品视频| 一级做a爱片久久| 国产精品你懂的| 日韩一级二级三级| 欧美日韩国产a| 日本韩国精品在线| 成人h动漫精品一区二区| 国产精品亚洲午夜一区二区三区| 国产精品一区免费视频| 欧美群妇大交群的观看方式| 91免费在线播放| 色婷婷国产精品| 欧美自拍偷拍一区| 欧美日韩一区三区四区| 91精品欧美综合在线观看最新 | 丁香婷婷深情五月亚洲| 成人在线视频一区二区| 成人免费高清在线| 色偷偷久久一区二区三区| 在线观看欧美日本| 91精品国产色综合久久ai换脸 | 欧美午夜精品免费| 欧美日韩免费观看一区三区| 欧美日韩一本到| 91精品国产91久久久久久最新毛片| 欧美日本一区二区三区四区| 日韩欧美综合在线| 久久久91精品国产一区二区精品 | 一区二区三区在线观看国产 | 国产成人免费高清| 一本到不卡精品视频在线观看| 欧洲一区在线观看| 91精品国产一区二区三区香蕉| 日韩午夜激情视频| 中文字幕不卡一区| 国产精品乡下勾搭老头1| zzijzzij亚洲日本少妇熟睡| 色欲综合视频天天天| 欧美日本韩国一区二区三区视频| 日韩三级精品电影久久久| 国产三级一区二区三区| 一区二区三区资源| 激情文学综合丁香| 色婷婷狠狠综合| 精品成人一区二区三区| 成人欧美一区二区三区1314| 亚洲国产综合色| 国产精品456露脸| 一本一本久久a久久精品综合麻豆| 91麻豆精品国产自产在线| 国产午夜精品久久| 三级久久三级久久| av网站一区二区三区| 欧美一区二区三区四区高清 | 亚洲自拍另类综合| 国产一二精品视频| 欧洲精品在线观看| 国产欧美日韩久久| 婷婷久久综合九色综合绿巨人| 国产精品正在播放| 欧美日韩国产另类不卡| 日本一区二区三区国色天香 | 国产一区二区三区最好精华液| 一本大道久久a久久综合婷婷| 日韩精品一区二区三区中文不卡| 亚洲人成小说网站色在线| 黄一区二区三区| 欧美女孩性生活视频| 国产精品久99| 韩国av一区二区三区| 欧美日韩视频一区二区| 自拍视频在线观看一区二区| 韩日欧美一区二区三区| 欧美久久久一区| 1024国产精品| 国产真实乱偷精品视频免| 精品视频1区2区3区| 亚洲视频在线一区| 懂色av中文一区二区三区| 精品福利视频一区二区三区| 亚洲午夜精品网| 色婷婷av一区| 亚洲免费观看高清完整版在线观看 | 久久久精品免费免费| 美女网站在线免费欧美精品| 欧美日韩中文字幕一区二区| 亚洲日韩欧美一区二区在线| 国产成人一级电影| 久久久久99精品一区| 狠狠色伊人亚洲综合成人| 日韩午夜激情av| 午夜精品影院在线观看| 欧美日韩免费电影| 亚洲成人午夜影院| 欧美日韩成人综合| 肉色丝袜一区二区| 6080yy午夜一二三区久久| 午夜久久久久久久久久一区二区| 欧美在线视频不卡| 亚洲gay无套男同| 4438成人网| 在线免费观看成人短视频| 专区另类欧美日韩| 色丁香久综合在线久综合在线观看 | 欧美r级电影在线观看| 欧美aaa在线| 精品久久国产字幕高潮| 久久精品99国产精品日本| 日韩精品一区二区三区老鸭窝| 久久精品999| 久久久久久久久久美女| 风流少妇一区二区| 亚洲丝袜精品丝袜在线| 在线观看视频一区| 无吗不卡中文字幕| 精品乱人伦一区二区三区| 国产成人综合网站| 成人免费在线播放视频| 欧美艳星brazzers| 日产精品久久久久久久性色| 精品久久久久久综合日本欧美| 国产精品白丝av| 亚洲欧美欧美一区二区三区| 欧美日韩亚洲综合在线 | 亚洲国产精品久久久久秋霞影院 | 国产精品理伦片| 色综合天天综合网国产成人综合天| 亚洲男女毛片无遮挡| 欧美精选一区二区| 国产综合色在线视频区| 国产精品久久久久久久岛一牛影视| 91免费看片在线观看| 日本一不卡视频| 国产片一区二区| 色婷婷久久99综合精品jk白丝| 日本免费新一区视频| 中文在线免费一区三区高中清不卡| 99re这里都是精品| 免费人成精品欧美精品| 欧美国产视频在线| 欧美日韩精品一区二区三区| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲精品视频自拍| 欧美大片拔萝卜| 色婷婷综合久久久中文一区二区 | 欧洲精品在线观看| 精品无码三级在线观看视频| 国产精品久久久久精k8| 91精品国产欧美日韩| 成人av小说网| 日本成人中文字幕在线视频| 国产精品美日韩| 91精品国产免费| 99精品久久久久久| 久久国产三级精品| 亚洲综合一区在线| 久久精品夜色噜噜亚洲aⅴ| 欧美揉bbbbb揉bbbbb| 成人高清视频在线| 久久精品国产网站| 亚洲午夜精品久久久久久久久| 国产日产欧产精品推荐色| 欧美一级夜夜爽| 91极品美女在线| 成人永久看片免费视频天堂| 奇米精品一区二区三区在线观看| 亚洲日本乱码在线观看| 国产三级一区二区| 精品99999|