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

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

?? mutablebiginteger.java

?? java源代碼 請(qǐng)看看啊 提點(diǎn)寶貴的意見
?? JAVA
?? 第 1 頁 / 共 3 頁
字號(hào):
            rem.value[j+rem.offset] = 0;            int borrow = mulsub(rem.value, d, qhat, dlen, j+rem.offset);            // D5 Test remainder            if (borrow + 0x80000000 > nh2) {                // D6 Add back                divadd(d, rem.value, j+1+rem.offset);                qhat--;            }            // Store the quotient digit            q[j] = qhat;        } // D7 loop on j        // D8 Unnormalize        if (shift > 0)            rem.rightShift(shift);        rem.normalize();        quotient.normalize();    }    /**     * Compare two longs as if they were unsigned.     * Returns true iff one is bigger than two.     */    private boolean unsignedLongCompare(long one, long two) {        return (one+Long.MIN_VALUE) > (two+Long.MIN_VALUE);    }    /**     * This method divides a long quantity by an int to estimate     * qhat for two multi precision numbers. It is used when      * the signed value of n is less than zero.     */    private void divWord(int[] result, long n, int d) {        long dLong = d & LONG_MASK;        if (dLong == 1) {            result[0] = (int)n;            result[1] = 0;            return;        }                        // Approximate the quotient and remainder        long q = (n >>> 1) / (dLong >>> 1);        long r = n - q*dLong;        // Correct the approximation        while (r < 0) {            r += dLong;            q--;        }        while (r >= dLong) {            r -= dLong;            q++;        }        // n - q*dlong == r && 0 <= r <dLong, hence we're done.        result[0] = (int)q;        result[1] = (int)r;    }    /**     * Calculate GCD of this and b. This and b are changed by the computation.     */    MutableBigInteger hybridGCD(MutableBigInteger b) {        // Use Euclid's algorithm until the numbers are approximately the        // same length, then use the binary GCD algorithm to find the GCD.        MutableBigInteger a = this;        MutableBigInteger q = new MutableBigInteger(),                          r = new MutableBigInteger();        while (b.intLen != 0) {            if (Math.abs(a.intLen - b.intLen) < 2)                return a.binaryGCD(b);            a.divide(b, q, r);            MutableBigInteger swapper = a;            a = b; b = r; r = swapper;        }        return a;    }    /**     * Calculate GCD of this and v.     * Assumes that this and v are not zero.     */    private MutableBigInteger binaryGCD(MutableBigInteger v) {        // Algorithm B from Knuth section 4.5.2        MutableBigInteger u = this;        MutableBigInteger q = new MutableBigInteger(),            r = new MutableBigInteger();        // step B1        int s1 = u.getLowestSetBit();        int s2 = v.getLowestSetBit();        int k = (s1 < s2) ? s1 : s2;        if (k != 0) {            u.rightShift(k);            v.rightShift(k);        }        // step B2        boolean uOdd = (k==s1);        MutableBigInteger t = uOdd ? v: u;        int tsign = uOdd ? -1 : 1;        int lb;        while ((lb = t.getLowestSetBit()) >= 0) {            // steps B3 and B4            t.rightShift(lb);            // step B5            if (tsign > 0)                u = t;            else                v = t;            // Special case one word numbers            if (u.intLen < 2 && v.intLen < 2) {                int x = u.value[u.offset];                int y = v.value[v.offset];                x  = binaryGcd(x, y);                r.value[0] = x;                r.intLen = 1;                r.offset = 0;                if (k > 0)                    r.leftShift(k);                return r;            }                            // step B6            if ((tsign = u.difference(v)) == 0)                break;            t = (tsign >= 0) ? u : v;        }        if (k > 0)            u.leftShift(k);        return u;    }    /**     * Calculate GCD of a and b interpreted as unsigned integers.     */    static int binaryGcd(int a, int b) {        if (b==0)            return a;        if (a==0)            return b;        int x;        int aZeros = 0;        while ((x = (int)a & 0xff) == 0) {            a >>>= 8;            aZeros += 8;        }        int y = BigInteger.trailingZeroTable[x];        aZeros += y;        a >>>= y;        int bZeros = 0;        while ((x = (int)b & 0xff) == 0) {            b >>>= 8;            bZeros += 8;        }        y = BigInteger.trailingZeroTable[x];        bZeros += y;        b >>>= y;        int t = (aZeros < bZeros ? aZeros : bZeros);        while (a != b) {            if ((a+0x80000000) > (b+0x80000000)) {  // a > b as unsigned                a -= b;                while ((x = (int)a & 0xff) == 0)                    a >>>= 8;                a >>>= BigInteger.trailingZeroTable[x];            } else {                b -= a;                while ((x = (int)b & 0xff) == 0)                    b >>>= 8;                b >>>= BigInteger.trailingZeroTable[x];            }        }        return a<<t;    }    /**     * Returns the modInverse of this mod p. This and p are not affected by     * the operation.     */    MutableBigInteger mutableModInverse(MutableBigInteger p) {        // Modulus is odd, use Schroeppel's algorithm        if (p.isOdd())            return modInverse(p);        // Base and modulus are even, throw exception        if (isEven())            throw new ArithmeticException("BigInteger not invertible.");        // Get even part of modulus expressed as a power of 2        int powersOf2 = p.getLowestSetBit();        // Construct odd part of modulus        MutableBigInteger oddMod = new MutableBigInteger(p);        oddMod.rightShift(powersOf2);        if (oddMod.isOne())            return modInverseMP2(powersOf2);        // Calculate 1/a mod oddMod        MutableBigInteger oddPart = modInverse(oddMod);        // Calculate 1/a mod evenMod        MutableBigInteger evenPart = modInverseMP2(powersOf2);        // Combine the results using Chinese Remainder Theorem        MutableBigInteger y1 = modInverseBP2(oddMod, powersOf2);        MutableBigInteger y2 = oddMod.modInverseMP2(powersOf2);        MutableBigInteger temp1 = new MutableBigInteger();        MutableBigInteger temp2 = new MutableBigInteger();        MutableBigInteger result = new MutableBigInteger();        oddPart.leftShift(powersOf2);        oddPart.multiply(y1, result);        evenPart.multiply(oddMod, temp1);        temp1.multiply(y2, temp2);        result.add(temp2);        result.divide(p, temp1, temp2);        return temp2;    }    /*     * Calculate the multiplicative inverse of this mod 2^k.     */    MutableBigInteger modInverseMP2(int k) {        if (isEven())            throw new ArithmeticException("Non-invertible. (GCD != 1)");        if (k > 64)            return euclidModInverse(k);        int t = inverseMod32(value[offset+intLen-1]);        if (k < 33) {            t = (k == 32 ? t : t & ((1 << k) - 1));            return new MutableBigInteger(t);        }                   long pLong = (value[offset+intLen-1] & LONG_MASK);        if (intLen > 1)            pLong |=  ((long)value[offset+intLen-2] << 32);        long tLong = t & LONG_MASK;        tLong = tLong * (2 - pLong * tLong);  // 1 more Newton iter step        tLong = (k == 64 ? tLong : tLong & ((1L << k) - 1));        MutableBigInteger result = new MutableBigInteger(new int[2]);        result.value[0] = (int)(tLong >>> 32);        result.value[1] = (int)tLong;        result.intLen = 2;        result.normalize();        return result;       }    /*     * Returns the multiplicative inverse of val mod 2^32.  Assumes val is odd.     */    static int inverseMod32(int val) {        // Newton's iteration!        int t = val;        t *= 2 - val*t;        t *= 2 - val*t;        t *= 2 - val*t;        t *= 2 - val*t;        return t;    }    /*     * Calculate the multiplicative inverse of 2^k mod mod, where mod is odd.     */    static MutableBigInteger modInverseBP2(MutableBigInteger mod, int k) {        // Copy the mod to protect original        return fixup(new MutableBigInteger(1), new MutableBigInteger(mod), k);    }    /**     * Calculate the multiplicative inverse of this mod mod, where mod is odd.     * This and mod are not changed by the calculation.     *     * This method implements an algorithm due to Richard Schroeppel, that uses     * the same intermediate representation as Montgomery Reduction     * ("Montgomery Form").  The algorithm is described in an unpublished     * manuscript entitled "Fast Modular Reciprocals."     */    private MutableBigInteger modInverse(MutableBigInteger mod) {        MutableBigInteger p = new MutableBigInteger(mod);        MutableBigInteger f = new MutableBigInteger(this);        MutableBigInteger g = new MutableBigInteger(p);        SignedMutableBigInteger c = new SignedMutableBigInteger(1);        SignedMutableBigInteger d = new SignedMutableBigInteger();        MutableBigInteger temp = null;        SignedMutableBigInteger sTemp = null;        int k = 0;        // Right shift f k times until odd, left shift d k times        if (f.isEven()) {            int trailingZeros = f.getLowestSetBit();            f.rightShift(trailingZeros);            d.leftShift(trailingZeros);            k = trailingZeros;        }                // The Almost Inverse Algorithm        while(!f.isOne()) {             // If gcd(f, g) != 1, number is not invertible modulo mod            if (f.isZero())                throw new ArithmeticException("BigInteger not invertible.");            // If f < g exchange f, g and c, d            if (f.compare(g) < 0) {                temp = f; f = g; g = temp;                sTemp = d; d = c; c = sTemp;            }            // If f == g (mod 4)             if (((f.value[f.offset + f.intLen - 1] ^                 g.value[g.offset + g.intLen - 1]) & 3) == 0) {                f.subtract(g);                c.signedSubtract(d);            } else { // If f != g (mod 4)                f.add(g);                c.signedAdd(d);            }            // Right shift f k times until odd, left shift d k times            int trailingZeros = f.getLowestSetBit();            f.rightShift(trailingZeros);            d.leftShift(trailingZeros);            k += trailingZeros;        }        while (c.sign < 0)           c.signedAdd(p);        return fixup(c, p, k);    }    /*     * The Fixup Algorithm     * Calculates X such that X = C * 2^(-k) (mod P)     * Assumes C<P and P is odd.     */    static MutableBigInteger fixup(MutableBigInteger c, MutableBigInteger p,                                                                      int k) {        MutableBigInteger temp = new MutableBigInteger();        // Set r to the multiplicative inverse of p mod 2^32        int r = -inverseMod32(p.value[p.offset+p.intLen-1]);        for(int i=0, numWords = k >> 5; i<numWords; i++) {            // V = R * c (mod 2^j)            int  v = r * c.value[c.offset + c.intLen-1];            // c = c + (v * p)            p.mul(v, temp);            c.add(temp);            // c = c / 2^j            c.intLen--;        }        int numBits = k & 0x1f;        if (numBits != 0) {            // V = R * c (mod 2^j)            int v = r * c.value[c.offset + c.intLen-1];                     v &= ((1<<numBits) - 1);                     // c = c + (v * p)            p.mul(v, temp);            c.add(temp);              // c = c / 2^j            c.rightShift(numBits);        }        // In theory, c may be greater than p at this point (Very rare!)        while (c.compare(p) >= 0)            c.subtract(p);        return c;    }    /**     * Uses the extended Euclidean algorithm to compute the modInverse of base     * mod a modulus that is a power of 2. The modulus is 2^k.     */    MutableBigInteger euclidModInverse(int k) {        MutableBigInteger b = new MutableBigInteger(1);        b.leftShift(k);        MutableBigInteger mod = new MutableBigInteger(b);        MutableBigInteger a = new MutableBigInteger(this);        MutableBigInteger q = new MutableBigInteger();        MutableBigInteger r = new MutableBigInteger();               b.divide(a, q, r);        MutableBigInteger swapper = b; b = r; r = swapper;        MutableBigInteger t1 = new MutableBigInteger(q);        MutableBigInteger t0 = new MutableBigInteger(1);        MutableBigInteger temp = new MutableBigInteger();        while (!b.isOne()) {            a.divide(b, q, r);            if (r.intLen == 0)                throw new ArithmeticException("BigInteger not invertible.");                        swapper = r; r = a; a = swapper;            if (q.intLen == 1)                t1.mul(q.value[q.offset], temp);            else                q.multiply(t1, temp);            swapper = q; q = temp; temp = swapper;            t0.add(q);                       if (a.isOne())                return t0;                       b.divide(a, q, r);            if (r.intLen == 0)                throw new ArithmeticException("BigInteger not invertible.");            swapper = b; b = r; r = swapper;            if (q.intLen == 1)                t0.mul(q.value[q.offset], temp);            else                q.multiply(t0, temp);            swapper = q; q = temp; temp = swapper;            t1.add(q);        }        mod.subtract(t1);        return mod;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美自拍丝袜亚洲| 国产午夜亚洲精品理论片色戒| 欧美写真视频网站| 久久久亚洲国产美女国产盗摄| 亚洲欧美在线观看| 激情av综合网| 欧美在线999| 国产精品久久久久久久第一福利| 水蜜桃久久夜色精品一区的特点| 成人精品视频.| 久久综合久色欧美综合狠狠| 性做久久久久久免费观看| 国产一区二区在线观看视频| 欧美日本一区二区三区| 最新热久久免费视频| 精品一区二区三区视频在线观看| 欧美综合视频在线观看| 国产精品久久久久婷婷二区次| 久久精品国产免费| 欧美精品三级在线观看| 亚洲人成伊人成综合网小说| 国产乱子伦一区二区三区国色天香| 欧美综合色免费| 亚洲欧洲另类国产综合| 国产高清无密码一区二区三区| 日韩免费成人网| 日韩专区一卡二卡| 欧美人与禽zozo性伦| 亚洲综合久久久| 欧美综合在线视频| 一区二区三区色| 欧洲亚洲精品在线| 亚洲图片欧美色图| 欧美日韩综合色| 午夜国产精品影院在线观看| 欧美欧美午夜aⅴ在线观看| 一区二区国产盗摄色噜噜| 9i看片成人免费高清| 中文字幕一区二区三区av| av亚洲精华国产精华精华| 亚洲国产精品成人综合| 丰满少妇久久久久久久 | 老色鬼精品视频在线观看播放| 欧美精品一二三四| 日韩成人av影视| 欧美日韩视频在线一区二区| 日韩综合小视频| 日韩欧美在线影院| 国产一区二区福利| 中文字幕一区二区三区在线播放 | 午夜精品一区在线观看| 精品视频123区在线观看| 亚洲gay无套男同| 日韩精品一区国产麻豆| 久久99国产精品免费| 国产网红主播福利一区二区| www.亚洲在线| 一级特黄大欧美久久久| 在线成人免费观看| 国产在线精品免费av| 国产精品免费久久| 欧美影院午夜播放| 久久精品国产澳门| 中文字幕在线一区二区三区| 欧美做爰猛烈大尺度电影无法无天| 日本怡春院一区二区| 国产欧美精品一区| 91成人国产精品| 国产一区二区三区香蕉| 亚洲欧美另类小说| 欧美一区二区国产| 成人免费毛片高清视频| 日韩电影在线一区二区| 中文字幕第一区二区| 欧美日韩国产高清一区二区| 国产乱人伦偷精品视频免下载| 有坂深雪av一区二区精品| 欧美电影免费观看高清完整版| 99热精品国产| 久久99精品久久久久久动态图| 中文字幕佐山爱一区二区免费| 欧美人与z0zoxxxx视频| 国产98色在线|日韩| 日韩精品成人一区二区在线| 国产精品无遮挡| 日韩一级二级三级| 日本久久精品电影| 国产精品一品二品| 美女脱光内衣内裤视频久久影院| 亚洲天堂福利av| 国产亚洲一区字幕| 在线不卡免费av| 91在线免费看| 国产老肥熟一区二区三区| 亚洲va天堂va国产va久| 亚洲人吸女人奶水| 日本一区二区免费在线观看视频| 欧美精品视频www在线观看| 91麻豆精品一区二区三区| 大胆亚洲人体视频| 狠狠久久亚洲欧美| 免费成人美女在线观看| 亚洲国产一区二区三区| 亚洲欧美电影院| 亚洲欧洲在线观看av| 国产日韩欧美a| 久久精品免视看| 久久久精品影视| 精品粉嫩aⅴ一区二区三区四区| 欧美日韩一级视频| 91免费小视频| 91蝌蚪porny成人天涯| 成人高清视频在线| 国产不卡一区视频| 国产白丝精品91爽爽久久| 国产毛片精品一区| 国产精品一区在线| 国精产品一区一区三区mba视频 | av高清不卡在线| 成人综合激情网| av一区二区三区在线| 成人丝袜高跟foot| 岛国一区二区在线观看| 不卡av在线免费观看| 99久久99久久精品免费看蜜桃| 成人av网站在线观看| 99久久亚洲一区二区三区青草| 成人综合日日夜夜| 99久久国产综合色|国产精品| gogo大胆日本视频一区| 色老头久久综合| 欧美另类videos死尸| 欧美精品少妇一区二区三区| 日韩一级片网址| 久久精品一区二区三区不卡牛牛 | 成人福利在线看| 成人免费观看男女羞羞视频| hitomi一区二区三区精品| 色噜噜狠狠成人中文综合| 7777精品伊人久久久大香线蕉经典版下载 | 99热99精品| 日本高清视频一区二区| 欧美日韩国产乱码电影| 日韩免费观看高清完整版在线观看| 精品国产乱码久久| 国产精品久久久久9999吃药| 亚洲精选在线视频| 视频在线在亚洲| 韩国成人福利片在线播放| 成人少妇影院yyyy| 欧美日韩一区二区三区不卡| 日韩你懂的在线播放| 国产精品日韩精品欧美在线| 亚洲一区二区三区中文字幕| 久久精品国产免费看久久精品| 成人的网站免费观看| 欧美剧情电影在线观看完整版免费励志电影 | 欧美大片一区二区三区| 中文一区在线播放 | 国产精品国产三级国产| 亚洲第一在线综合网站| 国产毛片精品国产一区二区三区| 色综合天天综合狠狠| 日韩免费看网站| 亚洲久本草在线中文字幕| 久久电影网电视剧免费观看| voyeur盗摄精品| 久久久亚洲欧洲日产国码αv| 亚洲一区二区在线视频| 福利电影一区二区| 日韩一级二级三级精品视频| 亚洲精品免费看| 国产精品一区二区三区99| 欧美日韩国产系列| 1区2区3区国产精品| 久久www免费人成看片高清| 色偷偷一区二区三区| 久久久亚洲精品一区二区三区 | 欧美人与性动xxxx| 中文字幕综合网| 国产精品一卡二卡| 欧美一区二区精品| 亚洲一区二区三区四区在线| 成人午夜av在线| 精品国产一二三| 日韩精品乱码av一区二区| 99久久精品免费精品国产| 日韩小视频在线观看专区| 一区二区三区四区不卡视频| 成人午夜又粗又硬又大| 26uuu久久天堂性欧美| 日本美女一区二区三区视频| 欧美综合在线视频| 亚洲六月丁香色婷婷综合久久 | 亚洲欧美日韩一区| 岛国精品在线播放| 中文字幕二三区不卡| 国产a精品视频| 久久精品亚洲国产奇米99| 狠狠色综合色综合网络|