Lines Matching +refs:val +refs:result
91 * the int val.
93 MutableBigInteger(int val) {
96 value[0] = val;
103 MutableBigInteger(int[] val) {
104 value = val;
105 intLen = val.length;
121 MutableBigInteger(MutableBigInteger val) {
122 intLen = val.intLen;
123 value = Arrays.copyOfRange(val.value, val.offset, val.offset + intLen);
247 int[] val = value;
251 long v = val[i++] & LONG_MASK;
335 int[] result = new int[intLen];
337 result[i] = value[offset+i];
338 return result;
342 * Sets the int at index+offset in this MutableBigInteger to val.
346 void setInt(int index, int val) {
347 value[offset + index] = val;
354 void setValue(int[] val, int length) {
355 value = val;
377 void copyValue(int[] val) {
378 int len = val.length;
381 System.arraycopy(val, 0, value, 0, len);
483 int[] result = new int[newLen];
485 result[i] = value[offset+i];
486 setValue(result, newLen);
510 * divisor a back to the dividend result at a specified offset. It is used
513 private int divadd(int[] a, int[] result, int offset) {
518 (result[j+offset] & LONG_MASK) + carry;
519 result[j+offset] = (int)sum;
552 int[] val = value;
554 for (int i=offset+intLen-1, c=val[i]; i>offset; i--) {
556 c = val[i-1];
557 val[i] = (c << n2) | (b >>> n);
559 val[offset] >>>= n;
568 int[] val = value;
570 for (int i=offset, c=val[i], m=i+intLen-1; i<m; i++) {
572 c = val[i+1];
573 val[i] = (b << n) | (c >>> n2);
575 val[offset+intLen-1] <<= n;
579 * Adds the contents of two MutableBigInteger objects.The result
587 int[] result = (value.length < resultLen ? new int[resultLen] : value);
589 int rstart = result.length-1;
598 result[rstart--] = (int)sum;
605 if (carry == 0 && result == value && rstart == (x + offset))
608 result[rstart--] = (int)sum;
614 result[rstart--] = (int)sum;
620 if (result.length < resultLen) {
623 // bits into new result.
624 System.arraycopy(result, 0, temp, 1, result.length);
626 result = temp;
628 result[rstart--] = 1;
632 value = result;
634 offset = result.length - resultLen;
640 * result into this MutableBigInteger.
645 int[] result = value;
659 if (result.length < resultLen)
660 result = new int[resultLen];
665 int rstart = result.length - 1;
673 result[rstart--] = (int)diff;
679 result[rstart--] = (int)diff;
682 value = result;
690 * Subtracts the smaller of a and b from the larger and places the result
728 * Multiply the contents of two MutableBigInteger objects. The result is
771 * result is placed into z.
1079 private void divWord(int[] result, long n, int d) {
1083 result[0] = (int)n;
1084 result[1] = 0;
1103 result[0] = (int)q;
1104 result[1] = (int)r;
1248 MutableBigInteger result = new MutableBigInteger();
1251 oddPart.multiply(y1, result);
1256 result.add(temp2);
1257 return result.divide(p, temp1);
1284 MutableBigInteger result = new MutableBigInteger(new int[2]);
1285 result.value[0] = (int)(tLong >>> 32);
1286 result.value[1] = (int)tLong;
1287 result.intLen = 2;
1288 result.normalize();
1289 return result;
1293 * Returns the multiplicative inverse of val mod 2^32. Assumes val is odd.
1295 static int inverseMod32(int val) {
1297 int t = val;
1298 t *= 2 - val*t;
1299 t *= 2 - val*t;
1300 t *= 2 - val*t;
1301 t *= 2 - val*t;