Home | History | Annotate | Download | only in bigint

Lines Matching refs:blk

30 void BigUnsigned::setBlock(Index i, Blk newBlock) {
33 blk[i] = 0;
43 blk[j] = 0;
46 blk[i] = newBlock;
57 Blk leftmostBlock = getBlock(len - 1);
69 Blk block = getBlock(blockI), mask = Blk(1) << (bi % N);
86 if (blk[i] == x.blk[i])
88 else if (blk[i] > x.blk[i])
143 Blk temp;
160 temp = a2->blk[i] + b2->blk[i];
163 carryOut = (temp < a2->blk[i]);
169 blk[i] = temp; // Save the addition result
175 temp = a2->blk[i] + 1;
177 blk[i] = temp;
182 blk[i] = a2->blk[i];
185 blk[i] = 1;
201 Blk temp;
208 temp = a.blk[i] - b.blk[i];
211 borrowOut = (temp > a.blk[i]);
217 blk[i] = temp; // Save the subtraction result
223 borrowIn = (a.blk[i] == 0);
224 blk[i] = a.blk[i] - 1;
235 blk[i] = a.blk[i];
245 * Programming'' (replace `place' by `Blk'):
285 * (1) The `N - y' low bits of `num.blk[x]', shifted `y' bits left.
287 * (2) The `y' high bits of `num.blk[x-1]', shifted `N - y' bits right.
294 * `a >> b' means `a >> (b % N)'. This means `num.blk[x-1] >> (N - y)'
295 * will return `num.blk[x-1]' instead of the desired 0 when `y == 0';
298 inline BigUnsigned::Blk getShiftedBlock(const BigUnsigned &num,
300 BigUnsigned::Blk part1 = (x == 0 || y == 0) ? 0 : (num.blk[x - 1] >> (BigUnsigned::N - y));
301 BigUnsigned::Blk part2 = (x == num.len) ? 0 : (num.blk[x] << y);
322 Blk temp;
329 blk[i] = 0;
334 if ((a.blk[i] & (Blk(1) << i2)) == 0)
354 temp = blk[k] + getShiftedBlock(b, j, i2);
355 carryOut = (temp < blk[k]);
360 blk[k] = temp;
366 blk[k]++;
367 carryIn = (blk[k] == 0);
372 if (blk[len - 1] == 0)
442 * subtractBuf[x] corresponds to blk[x], not blk[x+i], since 2005.01.11.
443 * But on a single iteration, we don't touch the i lowest blocks of blk
451 Blk temp;
469 blk[origLen] = 0; // Zero the added block.
472 Blk *subtractBuf = new Blk[len];
479 q.blk[i] = 0;
486 // (Remember, N is the number of bits in a Blk.)
487 blk[i] = 0;
500 temp = blk[k] - getShiftedBlock(b, j, i2);
501 borrowOut = (temp > blk[k]);
506 // Since 2005.01.11, indices of `subtractBuf' directly match those of `blk', so use `k'.
513 borrowIn = (blk[k] == 0);
514 subtractBuf[k] = blk[k] - 1;
527 q.blk[i] |= (Blk(1) << i2);
530 blk[k] = subtractBuf[k];
536 if (q.blk[q.len - 1] == 0)
556 blk[i] = a.blk[i] & b.blk[i];
573 blk[i] = a2->blk[i] | b2->blk[i];
575 blk[i] = a2->blk[i];
593 blk[i] = a2->blk[i] ^ b2->blk[i];
595 blk[i] = a2->blk[i];
617 blk[i] = 0;
619 blk[i] = getShiftedBlock(a, j, shiftBits);
621 if (blk[len - 1] == 0)
653 blk[i] = getShiftedBlock(a, j, leftShiftBits);
655 if (blk[len - 1] == 0)
666 blk[i]++;
667 carry = (blk[i] == 0);
673 blk[i] = 1;
689 borrow = (blk[i] == 0);
690 blk[i]--;
693 if (blk[len - 1] == 0)