Home | History | Annotate | Download | only in i18n

Lines Matching full:carry

1080   /* If not violated then carry out the operation.  */
1298 /* then carry out the operation. */
1440 /* then carry out the operation. */
2193 else { /* carry on with integer */
3034 /* Carry out the Hull correction */
3814 /* -- a carry to digits+1 digits looks possible */
3967 /* is all in one unit, no operand rounding is needed, and no carry, */
4060 /* If destructive overlap, or the number is too long, or a carry or */
4066 /* needed, +1 Unit for carry or borrow */
4853 /* chunks, and also uses a lazy carry strategy to minimise expensive */
4888 #define FASTLAZY 18 /* carry resolution point [1->18] */
4892 #define FASTLAZY 1844 /* carry resolution point [1->1844] */
4896 /* lazy carry evaluation */
4912 Int lazy; /* lazy carry counter */
4913 uLong lcarry; /* uLong carry */
4914 uInt carry; /* carry (NB not uLong) */
5049 /* a uLong without overflowing, so intermediate carry */
5051 /* short numbers usually only the one final carry resolution */
5056 lazy=FASTLAZY; /* carry delay count */
5073 if (lcarry<FASTBASE) carry=(uInt)lcarry; /* [usual] */
5074 else { /* two-place carry [fairly rare] */
5078 carry=(uInt)(lcarry-((uLong)FASTBASE*carry2)); /* [inline] */
5080 *(lp+1)+=carry; /* add to item above [inline] */
5081 *lp-=((uLong)FASTBASE*carry); /* [inline] */
5082 } /* carry resolution */
5514 a=t; /* and carry on using t instead of a */
6343 /* shift), or one Unit longer than that (if a Unit carry occurred). */
6365 /* safe, allowing space if necessary for a one-Unit carry. */
6384 eInt carry=0; /* carry integer (could be Long) */
6418 /* Carry handling is the same (i.e., duplicated) in each case. */
6420 carry+=*a;
6422 carry+=((eInt)*b)*m; /* [special-casing m=1/-1 */
6424 /* here carry is new Unit of digits; it could be +ve or -ve */
6425 if ((ueInt)carry<=DECDPUNMAX) { /* fastpath 0-DECDPUNMAX */
6426 *c=(Unit)carry;
6427 carry=0;
6431 if (carry>=0) {
6432 est=(((ueInt)carry>>11)*53687)>>18;
6433 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6434 carry=est; /* likely quotient [89%] */
6436 carry++;
6441 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6442 est=(((ueInt)carry>>11)*53687)>>18;
6443 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6444 carry=est-(DECDPUNMAX+1); /* correctly negative */
6446 carry++;
6449 if (carry>=0) {
6450 est=(((ueInt)carry>>3)*16777)>>21;
6451 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6452 carry=est; /* likely quotient [99%] */
6454 carry++;
6459 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6460 est=(((ueInt)carry>>3)*16777)>>21;
6461 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6462 carry
6464 carry++;
6467 /* Can use QUOT10 as carry <= 4 digits */
6468 if (carry>=0) {
6469 est=QUOT10(carry, DECDPUN);
6470 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6471 carry=est; /* quotient */
6475 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6476 est=QUOT10(carry, DECDPUN);
6477 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6478 carry=est-(DECDPUNMAX+1); /* correctly negative */
6481 if ((ueInt)carry<(DECDPUNMAX+1)*2) { /* fastpath carry +1 */
6482 *c=(Unit)(carry-(DECDPUNMAX+1)); /* [helps additions] */
6483 carry=1;
6486 if (carry>=0) {
6487 *c=(Unit)(carry%(DECDPUNMAX+1));
6488 carry=carry/(DECDPUNMAX+1);
6492 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6493 *c=(Unit)(carry%(DECDPUNMAX+1));
6494 carry=carry/(DECDPUNMAX+1)-(DECDPUNMAX+1);
6502 carry+=*a;
6506 carry+=((eInt)*b)*m;
6509 /* here carry is new Unit of digits; it could be +ve or -ve and */
6511 if ((ueInt)carry<=DECDPUNMAX) { /* fastpath 0-DECDPUNMAX */
6512 *c=(Unit)carry;
6513 carry=0;
6518 if (carry>=0) {
6519 est=(((ueInt)carry>>11)*53687)>>18;
6520 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6521 carry=est; /* likely quotient [79.7%] */
6523 carry++;
6528 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6529 est=(((ueInt)carry>>11)*53687)>>18;
6530 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6531 carry=est-(DECDPUNMAX+1); /* correctly negative */
6533 carry++;
6536 if (carry>=0) {
6537 est=(((ueInt)carry>>3)*16777)>>21;
6538 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6539 carry=est; /* likely quotient [99%] */
6541 carry++;
6546 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6547 est=(((ueInt)carry>>3)*16777)>>21;
6548 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6549 carry=est-(DECDPUNMAX+1); /* correctly negative */
6551 carry++;
6554 if (carry>=0) {
6555 est=QUOT10(carry, DECDPUN);
6556 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6557 carry=est; /* quotient */
6561 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6562 est=QUOT10(carry, DECDPUN);
6563 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6564 carry=est-(DECDPUNMAX+1); /* correctly negative */
6566 if ((ueInt)carry<(DECDPUNMAX+1)*2){ /* fastpath carry 1 */
6567 *c=(Unit)(carry-(DECDPUNMAX+1));
6568 carry=1;
6572 if (carry>=0) {
6573 *c=(Unit)(carry%(DECDPUNMAX+1));
6574 carry=carry/(DECDPUNMAX+1);
6578 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6579 *c=(Unit)(carry%(DECDPUNMAX+1));
6580 carry=carry/(DECDPUNMAX+1)-(DECDPUNMAX+1);
6584 /* OK, all A and B processed; might still have carry or borrow */
6586 if (carry==0) return c-clsu; /* no carry, so no more to do */
6587 if (carry>0) { /* positive carry */
6588 *c=(Unit)carry; /* place as new unit */
6592 /* -ve carry: it's a borrow; complement needed */
6593 add=1; /* temporary carry... */
6607 printf("UAS borrow: add %ld, carry %ld\n", add, carry);
6609 if ((add-carry-1)!=0) {
6610 *c=(Unit)(add-carry-1);