Home | History | Annotate | Download | only in i18n

Lines Matching refs:carry

1067   /* If not violated then carry out the operation.  */
1285 /* then carry out the operation. */
1423 /* then carry out the operation. */
2173 else { /* carry on with integer */
3010 /* Carry out the Hull correction */
3787 /* -- a carry to digits+1 digits looks possible */
3940 /* is all in one unit, no operand rounding is needed, and no carry, */
4033 /* If destructive overlap, or the number is too long, or a carry or */
4039 /* needed, +1 Unit for carry or borrow */
4824 /* chunks, and also uses a lazy carry strategy to minimise expensive */
4859 #define FASTLAZY 18 /* carry resolution point [1->18] */
4863 #define FASTLAZY 1844 /* carry resolution point [1->1844] */
4867 /* lazy carry evaluation */
4883 Int lazy; /* lazy carry counter */
4884 uLong lcarry; /* uLong carry */
4885 uInt carry; /* carry (NB not uLong) */
5016 /* a uLong without overflowing, so intermediate carry */
5018 /* short numbers usually only the one final carry resolution */
5023 lazy=FASTLAZY; /* carry delay count */
5040 if (lcarry<FASTBASE) carry=(uInt)lcarry; /* [usual] */
5041 else { /* two-place carry [fairly rare] */
5045 carry=(uInt)(lcarry-((uLong)FASTBASE*carry2)); /* [inline] */
5047 *(lp+1)+=carry; /* add to item above [inline] */
5048 *lp-=((uLong)FASTBASE*carry); /* [inline] */
5049 } /* carry resolution */
5481 a=t; /* and carry on using t instead of a */
6303 /* shift), or one Unit longer than that (if a Unit carry occurred). */
6325 /* safe, allowing space if necessary for a one-Unit carry. */
6344 eInt carry=0; /* carry integer (could be Long) */
6378 /* Carry handling is the same (i.e., duplicated) in each case. */
6380 carry+=*a;
6382 carry+=((eInt)*b)*m; /* [special-casing m=1/-1 */
6384 /* here carry is new Unit of digits; it could be +ve or -ve */
6385 if ((ueInt)carry<=DECDPUNMAX) { /* fastpath 0-DECDPUNMAX */
6386 *c=(Unit)carry;
6387 carry=0;
6391 if (carry>=0) {
6392 est=(((ueInt)carry>>11)*53687)>>18;
6393 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6394 carry=est; /* likely quotient [89%] */
6396 carry++;
6401 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6402 est=(((ueInt)carry>>11)*53687)>>18;
6403 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6404 carry=est-(DECDPUNMAX+1); /* correctly negative */
6406 carry++;
6409 if (carry>=0) {
6410 est=(((ueInt)carry>>3)*16777)>>21;
6411 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6412 carry=est; /* likely quotient [99%] */
6414 carry++;
6419 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6420 est=(((ueInt)carry>>3)*16777)>>21;
6421 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6422 carry=est-(DECDPUNMAX+1); /* correctly negative */
6424 carry++;
6427 /* Can use QUOT10 as carry <= 4 digits */
6428 if (carry>=0) {
6429 est=QUOT10(carry, DECDPUN);
6430 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6431 carry=est; /* quotient */
6435 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6436 est=QUOT10(carry, DECDPUN);
6437 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6438 carry=est-(DECDPUNMAX+1); /* correctly negative */
6441 if ((ueInt)carry<(DECDPUNMAX+1)*2) { /* fastpath carry +1 */
6442 *c=(Unit)(carry-(DECDPUNMAX+1)); /* [helps additions] */
6443 carry=1;
6446 if (carry>=0) {
6447 *c=(Unit)(carry%(DECDPUNMAX+1));
6448 carry=carry/(DECDPUNMAX+1);
6452 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6453 *c=(Unit)(carry%(DECDPUNMAX+1));
6454 carry=carry/(DECDPUNMAX+1)-(DECDPUNMAX+1);
6462 carry+=*a;
6466 carry+=((eInt)*b)*m;
6469 /* here carry
6471 if ((ueInt)carry<=DECDPUNMAX) { /* fastpath 0-DECDPUNMAX */
6472 *c=(Unit)carry;
6473 carry=0;
6478 if (carry>=0) {
6479 est=(((ueInt)carry>>11)*53687)>>18;
6480 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6481 carry=est; /* likely quotient [79.7%] */
6483 carry++;
6488 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6489 est=(((ueInt)carry>>11)*53687)>>18;
6490 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6491 carry=est-(DECDPUNMAX+1); /* correctly negative */
6493 carry++;
6496 if (carry>=0) {
6497 est=(((ueInt)carry>>3)*16777)>>21;
6498 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6499 carry=est; /* likely quotient [99%] */
6501 carry++;
6506 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6507 est=(((ueInt)carry>>3)*16777)>>21;
6508 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6509 carry=est-(DECDPUNMAX+1); /* correctly negative */
6511 carry++;
6514 if (carry>=0) {
6515 est=QUOT10(carry, DECDPUN);
6516 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6517 carry=est; /* quotient */
6521 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6522 est=QUOT10(carry, DECDPUN);
6523 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6524 carry=est-(DECDPUNMAX+1); /* correctly negative */
6526 if ((ueInt)carry<(DECDPUNMAX+1)*2){ /* fastpath carry 1 */
6527 *c=(Unit)(carry-(DECDPUNMAX+1));
6528 carry=1;
6532 if (carry>=0) {
6533 *c=(Unit)(carry%(DECDPUNMAX+1));
6534 carry=carry/(DECDPUNMAX+1);
6538 carry=carry+(eInt)(DECDPUNMAX+1)*(DECDPUNMAX+1); /* make positive */
6539 *c=(Unit)(carry%(DECDPUNMAX+1));
6540 carry=carry/(DECDPUNMAX+1)-(DECDPUNMAX+1);
6544 /* OK, all A and B processed; might still have carry or borrow */
6546 if (carry==0) return c-clsu; /* no carry, so no more to do */
6547 if (carry>0) { /* positive carry */
6548 *c=(Unit)carry; /* place as new unit */
6552 /* -ve carry: it's a borrow; complement needed */
6553 add=1; /* temporary carry... */
6567 printf("UAS borrow: add %ld, carry %ld\n", add, carry);
6569 if ((add-carry-1)!=0) {
6570 *c=(Unit)(add-carry-1);