Package java.math

Examples of java.math.BigInteger.multiply()


        /* Now we have d/10^k = b/S and
           (mhi * 2^m2) / S = maximum acceptable error, divided by 10^k. */
        if (k_check) {
            if (b.compareTo(S) < 0) {
                k--;
                b = b.multiply(BigInteger.valueOf(10))/* we botched the k estimate */
                if (leftright)
                    mhi = mhi.multiply(BigInteger.valueOf(10));
                ilim = ilim1;
            }
        }
View Full Code Here


                    return k + 1;
                }
                buf.append(dig);
                if (i == ilim)
                    break;
                b = b.multiply(BigInteger.valueOf(10));
                if (mlo == mhi)
                    mlo = mhi = mhi.multiply(BigInteger.valueOf(10));
                else {
                    mlo = mlo.multiply(BigInteger.valueOf(10));
                    mhi = mhi.multiply(BigInteger.valueOf(10));
View Full Code Here

                b = divResult[1];
                dig = (char)(divResult[0].intValue() + '0');
                buf.append(dig);
                if (i >= ilim)
                    break;
                b = b.multiply(BigInteger.valueOf(10));
            }

        /* Round off last digit */

        b = b.shiftLeft(1);
View Full Code Here

        /* Now we have d/10^k = b/S and
           (mhi * 2^m2) / S = maximum acceptable error, divided by 10^k. */
        if (k_check) {
            if (b.compareTo(S) < 0) {
                k--;
                b = b.multiply(BigInteger.valueOf(10))/* we botched the k estimate */
                if (leftright)
                    mhi = mhi.multiply(BigInteger.valueOf(10));
                ilim = ilim1;
            }
        }
View Full Code Here

                    return k + 1;
                }
                buf.append(dig);
                if (i == ilim)
                    break;
                b = b.multiply(BigInteger.valueOf(10));
                if (mlo == mhi)
                    mlo = mhi = mhi.multiply(BigInteger.valueOf(10));
                else {
                    mlo = mlo.multiply(BigInteger.valueOf(10));
                    mhi = mhi.multiply(BigInteger.valueOf(10));
View Full Code Here

                b = divResult[1];
                dig = (char)(divResult[0].intValue() + '0');
                buf.append(dig);
                if (i >= ilim)
                    break;
                b = b.multiply(BigInteger.valueOf(10));
            }

        /* Round off last digit */

        b = b.shiftLeft(1);
View Full Code Here

                do
                {
                    P = new BigInteger(q.bitLength(), rand);
                }
                while (P.compareTo(q) >= 0
                    || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, q).equals(qMinusOne)));

                BigInteger[] result = lucasSequence(q, P, Q, k);
                U = result[0];
                V = result[1];
View Full Code Here

            }
            while (r.equals(ZERO));

            BigInteger d = ((ECPrivateKeyParameters)key).getD();

            s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n);
        }
        while (s.equals(ZERO));

        BigInteger[]  res = new BigInteger[2];
View Full Code Here

            }
            while (r.equals(ECConstants.ZERO));

            BigInteger d = ((ECPrivateKeyParameters)key).getD();

            s = (k.multiply(e)).add(d.multiply(r)).mod(n);
        }
        while (s.equals(ECConstants.ZERO));

        BigInteger[]  res = new BigInteger[2];
View Full Code Here

        {
            u = u.multiply((BigInteger)smallPrimes.elementAt(i));
        }
        for (int i = smallPrimes.size() / 2; i < smallPrimes.size(); i++)
        {
            v = v.multiply((BigInteger)smallPrimes.elementAt(i));
        }

        BigInteger sigma = u.multiply(v);

        // n = (2 a u p_ + 1 ) ( 2 b v q_ + 1)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.