Lines Matching refs:result

69  * return a non-negative result, between {@code 0} and {@code (modulus - 1)},
226 * result in a BigInteger value of 0, whether signum is -1, 0 or 1.
411 // Assumes start < end. The result may be negative, but it
414 int result = Character.digit(source[start++], 10);
415 if (result == -1)
422 result = 10*result + nextVal;
425 return result;
664 BigInteger result = this.add(ONE);
667 if (result.bitLength() < SMALL_PRIME_THRESHOLD) {
670 if (!result.testBit(0))
671 result = result.add(ONE);
675 if (result.bitLength() > 6) {
676 long r = result.remainder(SMALL_PRIME_PRODUCT).longValue();
680 result = result.add(TWO);
686 if (result.bitLength() < 4)
687 return result;
690 if (result.primeToCertainty(DEFAULT_PRIME_CERTAINTY, null))
691 return result;
693 result = result.add(TWO);
698 if (result.testBit(0))
699 result = result.subtract(ONE);
702 int searchLen = (result.bitLength() / 20) * 64;
705 BitSieve searchSieve = new BitSieve(result, searchLen);
706 BigInteger candidate = searchSieve.retrieve(result,
710 result = result.add(BigInteger.valueOf(2 * searchLen));
1075 int result[] = new int[xIndex];
1082 result[xIndex] = (int)sum;
1088 carry = ((result[--xIndex] = x[xIndex] + 1) == 0);
1092 result[--xIndex] = x[xIndex];
1094 // Grow result if necessary
1096 int bigger[] = new int[result.length + 1];
1097 System.arraycopy(result, 0, bigger, 1, result.length);
1101 return result;
1135 int result[] = new int[bigIndex];
1144 result[bigIndex] = (int)difference;
1150 borrow = ((result[--bigIndex] = big[bigIndex] - 1) == -1);
1154 result[--bigIndex] = big[bigIndex];
1156 return result;
1169 int[] result = multiplyToLen(mag, mag.length,
1171 result = trustedStripLeadingZeroInts(result);
1172 return new BigInteger(result, signum == val.signum ? 1 : -1);
1219 * the result into z. There will be no leading zeros in the resultant array.
1264 * Squares the contents of the int array x. The result is placed into the
1358 BigInteger[] result = new BigInteger[2];
1363 result[0] = q.toBigInteger(this.signum == val.signum ? 1 : -1);
1364 result[1] = r.toBigInteger(this.signum);
1365 return result;
1402 int[] result = {1};
1406 result = multiplyToLen(result, result.length,
1408 result = trustedStripLeadingZeroInts(result);
1415 return new BigInteger(result, newSign);
1435 MutableBigInteger result = a.hybridGCD(b);
1437 return result.toBigInteger(1);
1462 int result[] = new int[nInts+len];
1464 result[i] = a[i];
1465 primitiveLeftShift(result, result.length, nBits);
1466 return result;
1468 int result[] = new int[nInts+len+1];
1470 result[i] = a[i];
1471 primitiveRightShift(result, result.length, 32 - nBits);
1472 return result;
1557 BigInteger result = this.remainder(m);
1558 return (result.signum >= 0 ? result : result.add(m));
1597 BigInteger result;
1599 result = base.oddModPow(exponent, m);
1628 result = a1.multiply(m2).multiply(y1).add
1632 return (invertResult ? result.modInverse(m) : result);
1668 * The loop walks down the exponent, squaring the result buffer as
1680 * When we start, there is one more optimization: the result buffer
1855 // Convert result out of Montgomery form and return
1927 * Multiply an array by one word k and add to result, return the carry
1974 BigInteger result = valueOf(1);
1985 result = result.multiply(baseToPow2).mod2(p);
1991 return result;
2042 MutableBigInteger result = a.mutableModInverse(b);
2043 return result.toBigInteger(1);
2191 int[] result = new int[Math.max(intLength(), val.intLength())];
2192 for (int i=0; i<result.length; i++)
2193 result[i] = (getInt(result.length-i-1)
2194 & val.getInt(result.length-i-1));
2196 return valueOf(result);
2208 int[] result = new int[Math.max(intLength(), val.intLength())];
2209 for (int i=0; i<result.length; i++)
2210 result[i] = (getInt(result.length-i-1)
2211 | val.getInt(result.length-i-1));
2213 return valueOf(result);
2225 int[] result = new int[Math.max(intLength(), val.intLength())];
2226 for (int i=0; i<result.length; i++)
2227 result[i] = (getInt(result.length-i-1)
2228 ^ val.getInt(result.length-i-1));
2230 return valueOf(result);
2241 int[] result = new int[intLength()];
2242 for (int i=0; i<result.length; i++)
2243 result[i] = ~getInt(result.length-i-1);
2245 return valueOf(result);
2259 int[] result = new int[Math.max(intLength(), val.intLength())];
2260 for (int i=0; i<result.length; i++)
2261 result[i] = (getInt(result.length-i-1)
2262 & ~val.getInt(result.length-i-1));
2264 return valueOf(result);
2298 int[] result = new int[Math.max(intLength(), intNum+2)];
2300 for (int i=0; i<result.length; i++)
2301 result[result.length-i-1] = getInt(i);
2303 result[result.length-intNum-1] |= (1 << (n & 31));
2305 return valueOf(result);
2322 int[] result = new int[Math.max(intLength(), ((n + 1) >>> 5) + 1)];
2324 for (int i=0; i<result.length; i++)
2325 result[result.length-i-1] = getInt(i);
2327 result[result.length-intNum-1] &= ~(1 << (n & 31));
2329 return valueOf(result);
2346 int[] result = new int[Math.max(intLength(), intNum+2)];
2348 for (int i=0; i<result.length; i++)
2349 result[result.length-i-1] = getInt(i);
2351 result[result.length-intNum-1] ^= (1 << (n & 31));
2353 return valueOf(result);
2647 // Put sign (if any) and first digit group into result buffer
2730 * result with the opposite sign.
2735 int result = 0;
2736 result = getInt(0);
2737 return result;
2750 * result with the opposite sign.
2755 long result = 0;
2758 result = (result << 32) + (getInt(i) & LONG_MASK);
2759 return result;
2842 int[] result = new int[intLength];
2845 result[i] = a[b--] & 0xff;
2849 result[i] |= ((a[b--] & 0xff) << j);
2851 return result;
2874 int result[] = new int[intLength];
2880 result[i] = a[b--] & 0xff;
2885 result[i] |= ((a[b--] & 0xff) << j);
2889 result[i] = ~result[i] & mask;
2893 for (int i=result.length-1; i>=0; i--) {
2894 result[i] = (int)((result[i] & LONG_MASK) + 1);
2895 if (result[i] != 0)
2899 return result;
2918 int result[] = new int[a.length - keep + extraInt];
2923 result[i - keep + extraInt] = ~a[i];
2926 for (int i=result.length-1; ++result[i]==0; i--)
2929 return result;
3171 byte[] result = new byte[byteLen];
3182 result[i] = (byte)nextInt;
3184 return result;