Lines Matching refs:up
62 /* precision (up to 999,999,999 digits) and arbitrary exponent */
160 /* numbers up to four digits, using appropriate constants. This */
237 /* of 17 [we only need up to **4] */
382 Unit *up; /* work pointer */
385 for (up=dn->lsu; uin>0; up++) {
386 *up=(Unit)(uin%(DECDPUNMAX+1));
389 dn->digits=decGetDigits(dn->lsu, up-dn->lsu);
412 const Unit *up; /* .. */
414 up=dn->lsu; /* -> lsu */
415 lo=*up; /* get 1 to 9 digits */
420 up++;
422 for (d=DECDPUN; d<dn->digits; up++, d+=DECDPUN) hi+=*up*powers[d-1];
448 const Unit *up; /* .. */
450 up=dn->lsu; /* -> lsu */
451 lo=*up; /* get 1 to 9 digits */
456 up++;
458 for (d=DECDPUN; d<dn->digits; up++, d+=DECDPUN) hi+=*up*powers[d-1];
525 Unit *up; /* .. */
642 /* [up to 1999999999 is OK, for example 1E-1000000998] */
690 up=res+D2U(d)-1; /* -> msu */
691 cut=d-(up-res)*DECDPUN; /* digits in top unit */
698 *up=(Unit)out; /* write unit */
699 up--; /* prepare for unit below.. */
703 *up=(Unit)out; /* write lsu */
707 up=res; /* -> lsu */
709 if (*c=='.') continue; /* ignore . [don't step up] */
710 *up=(Unit)((Int)*c-(Int)'0');
711 up++;
836 ua=lhs->lsu; /* bottom-up */
1063 /* almost always be correctly rounded, but may be up to 1 ulp in */
1152 /* set up context for multiply */
1158 /* set up decNumber space to receive the result of the multiply */
1231 ua=rhs->lsu; /* bottom-up */
1283 /* almost always be correctly rounded, but may be up to 1 ulp in */
1402 /* almost always be correctly rounded, but may be up to 1 ulp in */
1524 uprv_decNumberZero(w); /* set up 10... */
1851 ua=lhs->lsu; /* bottom-up */
1969 /* almost always be correctly rounded, but may be up to 1 ulp in */
2034 uprv_decNumberZero(&dnOne); /* set up 1 */
2172 /* here, aset is set up and accumulator is ready for use */
2522 /* 1. shift all to least up to one unit to unit-align final */
2860 /* buffer for temporary variable, up to 3 digits */
2862 decNumber *t=buft; /* up-to-3-digit constant or work */
2949 /* set up working context */
3281 ua=lhs->lsu; /* bottom-up */
3490 const Unit *up=dn->lsu; /* Unit pointer, -> lsu */
3493 for (; ub>=bcd; ub--, up++) *ub=*up;
3495 uInt u=*up; /* work */
3502 up++;
3503 u=*up;
3523 Unit *up=dn->lsu+D2U(dn->digits)-1; /* -> msu [target pointer] */
3527 for (; ub<bcd+n; ub++, up--) *up=*ub;
3531 for (;up>=dn->lsu; up--) { /* each Unit from msu */
3532 *up=0; /* will take <=DECDPUN digits */
3533 for (; cut>0; ub++, cut--) *up=X10(*up)+*ub;
3658 const Unit *up=dn->lsu+D2U(dn->digits)-1; /* -> msu [input pointer] */
3694 for (;up>=dn->lsu; up--) { /* each Unit from msu */
3695 u=*up; /* contains DECDPUN digits to lay out */
3734 u=*up;
3739 if (up==dn->lsu) break; /* out of input digits (pre>digits) */
3740 up--;
3742 u=*up;
3750 if (up==dn->lsu) break; /* out of input digits */
3751 up--;
3753 u=*up;
3766 if (up==dn->lsu) break; /* out of input digits */
3767 up--;
3769 u=*up;
4008 /* other) padding with up to DIGITS-1 trailing zeros may be */
4031 /* so only need to pad up to a length of DIGITS+1. */
4115 /* remove leading zeros that were added due to rounding up to */
4133 /* remove leading zeros that added due to rounding up to */
4244 /* 1) to accumulate the result, and the other (up to 2*digits+1) for */
4433 /* Long (slow) division is needed; roll up the sleeves... */
4488 /* now set up the variables which will be used for estimating the */
4653 /* Had an exact division; clean up spurious trailing 0s. */
4739 Unit *up; /* .. */
4758 for (up=accnext; up<accnext+tarunits; up++) {
4760 half=*up & 0x01;
4761 *up/=2; /* [shift] */
4763 *(up-1)+=(DECDPUNMAX+1)/2;
4769 /* This is effectively causing round-up of the quotient, */
4775 for (up=quotlsu; ; up++) {
4777 if (*up!=DECDPUNMAX) break;/* non-nines */
4780 if (*up==powers[quotdigits]-1) allnines=1;
4784 } /* up */
4860 /* fastpath can speed up some 16-digit operations by 10x (and much */
4921 Unit *up; /* .. */
5004 /* (rounded up to a multiple of 8 bytes), and the uLong */
5046 /* Each uLong item in the accumulator can hold values up to */
5069 /* spin up the accumulator resolving overflows */
5093 /* each item in the accumulator (which will become up to N */
5095 for (lp=zacc, up=acc; lp<zacc+iacc; lp++) {
5097 for (p=0; p<FASTDIGS-DECDPUN; p+=DECDPUN, up++) {
5099 *up=(Unit)(item-(part*(DECDPUNMAX+1)));
5102 *up=(Unit)item; up++; /* [final needs no division] */
5104 accunits=up-acc; /* count of units */
5205 /* almost always be correctly rounded, but may be up to 1 ulp in */
5350 /* set up the context to be used for calculating a, as this is */
5367 /* set up here so Power call below will over or underflow to */
5383 /* Apply as much as possible, up to a MAXLEVER digits, which */
5392 use+=h; /* [may end up subnormal] */
5456 /* set up the contexts for calculating a, t, and d */
5588 /* almost always be correctly rounded, but may be up to 1 ulp in */
5610 /* 3. Fastpaths are included for ln(10) and ln(2), up to length 40, */
5617 /* iterations will be neede -- so this would only speed up by */
5707 /* be able to hold p digits, and the adjustment up to */
5752 t=LNnn[t-10]; /* look up ln(b) */
5758 /* the initial estimate is now in a, with up to 4 digits correct. */
5769 /* set up a context to be used for the multiply and subtract */
5775 /* up to a maximum of p */
5953 /* if adjusted coefficient will definitely not fit, give up now */
6080 /* If total ordering then handle differing signs 'up front' */
6329 /* clean up and return the result */
6514 /* magnitude up to DECDPUNMAX squared */
6639 Unit *up; /* -> current Unit */
6656 up=dn->lsu; /* -> current Unit */
6660 uInt quot=QUOT10(*up, cut);
6661 if ((*up-quot*powers[cut])!=0) break; /* found non-0 digit */
6663 if (*up%powers[cut]!=0) break; /* found non-0 digit */
6675 up++;
6748 first=uar+D2U(digits+shift)-1; /* where msu of source will end up */
6786 Unit *target, *up; /* work */
6799 up=uar+D2U(shift);
6800 for (; up<uar+units; target++, up++) *target=*up;
6805 up=uar+D2U(shift-cut); /* source; correct to whole Units */
6808 quot=QUOT10(*up, cut);
6810 quot=*up/powers[cut];
6816 up++;
6817 quot=*up;
6820 rem=*up-quot*powers[cut];
6937 const Unit *up; /* work */
6949 up=lsu;
6950 for (target=dn->lsu; count>0; target++, up++, count-=DECDPUN)
6951 *target=*up;
6969 for (up=lsu; count>0; up++, count-=DECDPUN) if (*up!=0) { /* found non-0 */
6983 /* spin up the number, noting residue during the spin, until get to */
6987 for (up=lsu;; up++) {
6990 if (*up!=0) *residue=1;
6991 } /* up */
6993 /* here up -> Unit with first discarded digit */
6998 if (*up>=half) {
6999 if (*up>half) *residue=7;
7003 if (*up!=0) *residue=3; /* [else is 0, leave as sticky bit] */
7010 count=set->digits; /* now digits to end up with */
7012 up++; /* move to next */
7014 for (target=dn->lsu; count>0; target++, up++, count-=DECDPUN)
7015 *target=*up;
7022 if (cut==0) quot=*up; /* is at bottom of unit */
7026 quot=QUOT10(*up, cut);
7027 rem=*up-quot*powers[cut];
7029 rem=*up%powers[cut];
7030 quot=*up/powers[cut];
7048 /* here: up -> Unit of the array with bottom digit */
7056 count=set->digits; /* now digits to end up with */
7063 up++;
7064 quot=*up;
7067 rem=*up-quot*powers[cut];
7126 case DEC_ROUND_05UP: { /* round zero or five up (for reround) */
7131 /* case it is bumped down and then up -- a no-op) */
7148 if (residue>5) bump=1; /* >0.5 goes up */
7150 /* 0.5 goes up iff [new] lsd is odd */
7193 /* now bump the number, up or down, if need be */
7196 /* Simply use decUnitAddSub unless bumping up and the number is */
7202 Unit *up; /* work */
7204 for (up=dn->lsu; ; up++) {
7207 if (*up!=powers[count]-1) break; /* not still 9s */
7209 *up=(Unit)powers[count-1]; /* here 999 -> 100 etc. */
7210 up=up-1; up>=dn->lsu; up--) *up=0; /* others all to 0 */
7219 if (*up!=DECDPUNMAX) break; /* not still 9s */
7221 } /* up */
7226 Unit *up, *sup; /* work */
7228 for (up=dn->lsu; ; up++) {
7231 if (*up!=powers[count-1]) break; /* not 100.. */
7233 sup=up; /* save msu pointer */
7234 *up=(Unit)powers[count]-1; /* here 100 in msu -> 999 */
7236 for (up=up-1; up>=dn->lsu; up--) *up=(Unit)powers[DECDPUN]-1;
7257 if (*up!=0) break; /* not still 0s */
7259 } /* up */
7326 /* be up to twice the expected]. */
7440 Unit *up; /* work */
7444 for (up=dn->lsu; ; up++) {
7445 if (count>DECDPUN) *up=DECDPUNMAX; /* unit full o'nines */
7447 *up=(Unit)(powers[count]-1);
7451 } /* up */
7530 /* if rounded up a 999s case, exponent will be off by one; adjust */
7589 const Unit *up; /* work */
7604 up=dn->lsu; /* ready for lsu */
7612 /* spin up whole units until reach the Unit with the unit digit */
7613 for (; count>=DECDPUN; up++) {
7614 if (*up!=0) return BADINT; /* non-zero Unit to discard */
7622 theInt=QUOT10(*up, count);
7623 rem=*up-theInt*powers[count];
7625 rem=*up%powers[count]; /* slice off discards */
7626 theInt=*up/powers[count];
7631 up++; /* ready for next */
7636 /* tricky code now, to accumulate up to 9.3 digits */
7637 if (got==0) {theInt=*up; got+=DECDPUN; up++;} /* ensure lsu is there */
7642 for (; got<ilength; up++) {
7643 theInt+=*up*powers[got];
7647 if (theInt/(Int)powers[got-DECDPUN]!=(Int)*(up-1)) ilength=11;
7738 /* This decision tree ends up with LHS being the source pointer, */
7788 /* if cause was an sNaN, clear and propagate [NaN is already set up] */
7813 Unit *up=uar+(len-1); /* -> msu */
7823 for (; up>=uar; up--) {
7824 if (*up==0) { /* unit is all 0s */
7830 if (*up<10) break; /* is 1-9 */
7833 if (*up<100) break; /* is 10-99 */
7836 if (*up<1000) break; /* is 100-999 */
7839 for (pow=&powers[4]; *up>=*pow; pow++) digits++;
7845 } /* up */
7859 const Unit *up; /* work */
7883 up=dn->lsu+D2U(dn->digits)-1; /* msu */
7884 printf("%ld", (LI)*up);
7885 for (up=up-1; up>=dn->lsu; up--) {
7886 u=*up;
7893 } /* up */
8002 const Unit *up; /* work */
8051 for (up=dn->lsu; d>0; up++) {
8055 if (dn->digits>1 && *up<powers[d-1]) {
8062 if (*up>maxuint) {
8065 (LI)*up, (LI)dn->digits, (LI)(up-dn->lsu), (LI)maxuint);