Lines Matching full:carry
180 /// 1 is returned if there is a carry out, otherwise 0 is returned.
181 /// @returns the carry of the addition.
186 y = 1; // Carry one to next digit.
188 y = 0; // No need to carry so exit early
235 /// @returns the carry out from the addition
239 bool carry = false;
242 dest[i] = x[i] + y[i] + carry;
243 carry = dest[i] < limit || (carry && dest[i] == limit);
245 return carry;
289 /// @returns the carry out of the multiplication.
294 uint64_t carry = 0;
301 // hasCarry - A flag to indicate if there is a carry to the next digit.
302 // hasCarry == 0, no carry
303 // hasCarry == 1, has carry
304 // hasCarry == 2, no carry and the calculation result == 0.
306 dest[i] = carry + lx * ly;
307 // Determine if the add above introduces carry.
308 hasCarry = (dest[i] < carry) ? 1 : 0;
309 carry = hx * ly + (dest[i] >> 32) + (hasCarry ? (1ULL << 32) : 0);
310 // The upper limit of carry can be (2^32 - 1)(2^32 - 1) +
312 hasCarry = (!carry && hasCarry) ? 1 : (!carry ? 2 : 0);
314 carry += (lx * hy) & 0xffffffffULL;
315 dest[i] = (carry << 32) | (dest[i] & 0xffffffffULL);
316 carry = (((!carry && hasCarry != 2) || hasCarry == 1) ? (1ULL << 32) : 0) +
317 (carry >> 32) + ((lx * hy) >> 32) + hx * hy;
319 return carry;
330 uint64_t carry = 0, lx = 0, hx = 0;
334 // hasCarry - A flag to indicate if has carry.
335 // hasCarry == 0, no carry
336 // hasCarry == 1, has carry
337 // hasCarry == 2, no carry and the calculation result == 0.
339 uint64_t resul = carry + lx * ly;
340 hasCarry = (resul < carry) ? 1 : 0;
341 carry = (hasCarry ? (1ULL << 32) : 0) + hx * ly + (resul >> 32);
342 hasCarry = (!carry && hasCarry) ? 1 : (!carry ? 2 : 0);
344 carry += (lx * hy) & 0xffffffffULL;
345 resul = (carry << 32) | (resul & 0xffffffffULL);
347 carry = (((!carry && hasCarry != 2) || hasCarry == 1) ? (1ULL << 32) : 0)+
348 (carry >> 32) + (dest[i+j] < resul ? 1 : 0) +
351 dest[i+xlen] = carry;
769 uint64_t Carry = 0;
772 Dst[I] = (Tmp >> Shift) | Carry;
773 Carry = Tmp << (64 - Shift);
1150 // If we are shifting less than a word, compute the shift with a simple carry
1208 uint64_t carry = 0;
1210 val[i] = pVal[i] << shiftAmt | carry;
1211 carry = pVal[i] >> (APINT_BITS_PER_WORD - shiftAmt);
1598 bool carry = true; // true because b's complement is "complement + 1"
1600 u[i] = ~u[i] + carry; // b's complement
1601 carry = carry && u[i] == 0;
1617 // A carry will occur to the left of u[j+n], and it should be ignored
1619 bool carry = false;
1622 u[j+i] += v[i] + carry;
1623 carry = u[j+i] < limit || (carry && u[j+i] == limit);
1625 u[j+n] += carry;
1646 unsigned carry = 0;
1649 r[i] = (u[i] >> shift) | carry;
1650 carry = u[i] << (32 - shift);
2454 /* DST += RHS + C where C is zero or one. Returns the carry flag. */
2479 /* DST -= RHS + C where C is zero or one. Returns the carry flag. */
2512 /* DST += SRC * MULTIPLIER + CARRY if add is true
2513 DST = SRC * MULTIPLIER + CARRY if add is false
2525 integerPart multiplier, integerPart carry,
2541 /* [ LOW, HIGH ] = MULTIPLIER * SRC[i] + DST[i] + CARRY.
2552 low = carry;
2572 /* Now add carry. */
2573 if (low + carry < low)
2575 low += carry;
2586 carry = high;
2592 carry;
2595 /* We overflowed if there is carry. */
2596 if (carry)
2844 /* Increment a bignum in-place, return the carry flag. */