Home | History | Annotate | Download | only in i18n

Lines Matching defs:lsu

167 /*      lsu -- least significant Unit (of coefficient)                */
368 for (up=dn->lsu; uin>0; up++) {
372 dn->digits=decGetDigits(dn->lsu, up-dn->lsu);
397 up=dn->lsu; /* -> lsu */
433 up=dn->lsu; /* -> lsu */
657 if (d<=set->digits) res=dn->lsu; /* fits into supplied decNumber */
667 /* res now -> number lsu, buffer, or allocated storage for Unit array */
686 *up=(Unit)out; /* write lsu */
690 up=res; /* -> lsu */
819 ua=lhs->lsu; /* bottom-up */
820 ub=rhs->lsu; /* .. */
821 uc=res->lsu; /* .. */
852 res->digits=decGetDigits(res->lsu, uc-res->lsu);
1214 ua=rhs->lsu; /* bottom-up */
1215 uc=res->lsu; /* .. */
1239 res->digits=decGetDigits(res->lsu, uc-res->lsu);
1451 if (!(copystat&DEC_Inexact) && w->lsu[0]==1) {
1505 w->lsu[1]=1; w->lsu[0]=0; /* .. */
1507 w->lsu[0]=10; /* .. */
1683 dtiny.lsu[0]=1; /* make number that is .. */
1720 dtiny.lsu[0]=1; /* make number that is .. */
1783 dtiny.lsu[0]=1; /* make number that is .. */
1827 ua=lhs->lsu; /* bottom-up */
1828 ub=rhs->lsu; /* .. */
1829 uc=res->lsu; /* .. */
1859 res->digits=decGetDigits(res->lsu, uc-res->lsu);
2011 dnOne.lsu[0]=1;
2017 else if (dac->lsu[0]==0) { /* lhs=1 */
2020 *res->lsu=1; /* was 0, make int 1 */
2021 res->digits=decShiftToMost(res->lsu, 1, shift);
2049 if (n==0) *res->lsu=1; /* [-]Inf**0 => 1 */
2067 *res->lsu=1; /* return 1 */
2121 *res->lsu=1; /* .. */
2158 *dac->lsu=1; /* was 0, make int 1 */
2161 dac->digits=decShiftToMost(dac->lsu, 1, shift);
2175 *dac->lsu=1; /* .. */
2491 Unit *msu=res->lsu+D2U(res->digits)-1; /* current msu */
2492 Unit *msumax=res->lsu+D2U(set->digits)-1; /* rotation msu */
2532 uInt save=res->lsu[0]%powers[shift]; /* save low digit(s) */
2533 decShiftToLeast(res->lsu, D2U(res->digits), shift);
2552 uInt save=res->lsu[0]%powers[shift]; /* save low digit(s) */
2553 decShiftToLeast(res->lsu, units, shift);
2559 decReverse(res->lsu+units, msumax); /* left part */
2560 decReverse(res->lsu, res->lsu+units-1); /* right part */
2561 decReverse(res->lsu, msumax); /* whole */
2565 res->digits=decGetDigits(res->lsu, msumax-res->lsu+1);
2598 *res->lsu=ret;
2700 *res->lsu=0; /* so place 0 */
2710 if (res->digits>1 || *res->lsu) /* if non-zero.. */
2711 res->digits=decShiftToMost(res->lsu, res->digits, shift);
2716 *res->lsu=0; /* so place 0 */
2720 decShiftToLeast(res->lsu, D2U(res->digits), -shift);
2938 t->lsu[0]=259;
2939 a->lsu[0]=819;
2941 t->lsu[0]=59; t->lsu[1]=2;
2942 a->lsu[0]=19; a->lsu[1]=8;
2944 t->lsu[0]=9; t->lsu[1]=5; t->lsu[2]=2;
2945 a->lsu[0]=9; a->lsu[1]=1; a->lsu[2]=8;
2955 t->lsu[0]=819;
2956 a->lsu[0]=259;
2958 t->lsu[0]=19; t->lsu[1]=8;
2959 a->lsu[0]=59; a->lsu[1]=2;
2961 t->lsu[0]=9; t->lsu[1]=1; t->lsu[2]=8;
2962 a->lsu[0]=9; a->lsu[1]=5; a->lsu[2]=2;
2974 t->lsu[0]=5; /* .. */
3027 t->lsu[0]=1; /* .. */
3041 t->lsu[0]=1; /* .. */
3094 decShiftToLeast(a->lsu, D2U(a->digits), todrop);
3250 ua=lhs->lsu; /* bottom-up */
3251 ub=rhs->lsu; /* .. */
3252 uc=res->lsu; /* .. */
3282 res->digits=decGetDigits(res->lsu, uc-res->lsu);
3361 /* more than just the lsu (for small DECDPUN). This would not affect */
3367 dest->lsu[0]=src->lsu[0];
3373 d=dest->lsu+1; /* -> first destination */
3374 smsup=src->lsu+D2U(src->digits); /* -> source msu+1 */
3375 for (s=src->lsu+1; s<smsup; s++, d++) *d=*s;
3459 const Unit *up=dn->lsu; /* Unit pointer, -> lsu */
3492 Unit *up=dn->lsu+D2U(dn->digits)-1; /* -> msu [target pointer] */
3500 for (;up>=dn->lsu
3597 dn->lsu[0]=0;
3627 const Unit *up=dn->lsu+D2U(dn->digits)-1; /* -> msu [input pointer] */
3654 if (exp!=0 || (*dn->lsu==0 && dn->digits==1)) return;
3663 for (;up>=dn->lsu; up--) { /* each Unit from msu */
3708 if (up==dn->lsu) break; /* out of input digits (pre>digits) */
3719 if (up==dn->lsu) break; /* out of input digits */
3735 if (up==dn->lsu) break; /* out of input digits */
3897 res->digits=decShiftToMost(res->lsu, res->digits, -adjust);
3924 res->digits=decShiftToMost(res->lsu, res->digits, -adjust);
3948 Int partial=*lhs->lsu;
3950 partial+=*rhs->lsu;
3955 *res->lsu=(Unit)partial; /* [copy could have overwritten RHS] */
3961 partial-=*rhs->lsu;
3964 *res->lsu=(Unit)partial;
3966 res->digits=decGetDigits(res->lsu, D2U(res->digits));
4011 res->digits=decShiftToMost(res->lsu, res->digits, shift);
4032 acc=res->lsu; /* assume add direct to result */
4056 decDumpAr('A', lhs->lsu, D2U(lhs->digits));
4057 decDumpAr('B', rhs->lsu, D2U(rhs->digits));
4062 res->digits=decUnitAddSub(lhs->lsu, D2U(lhs->digits),
4063 rhs->lsu, D2U(rhs->digits),
4078 if (acc!=res->lsu) {
4120 res->digits=decGetDigits(res->lsu, D2U(res->digits));
4446 source=lhs->lsu+D2U(lhs->digits)-1; /* msu of input array */
4447 for (target=msu1; source>=lhs->lsu; source--, target--) *target=*source;
4453 var2=rhs->lsu; /* -> rhs array */
4545 /* The var2 msu is one unit towards the lsu of the var1 msu, */
4604 /* if early stop), starting at accnext+1 (its lsu) */
4625 Unit lsu=*accnext;
4626 if (!(lsu&0x01) && (lsu!=0)) {
4629 for (;; drop++) { /* [will terminate because lsu!=0] */
4632 if ((lsu-QUOT10(lsu, drop+1)
4635 if (lsu%powers[drop+1]!=0) break; /* found non-0 digit */
4717 compare=decUnitCompare(accnext, tarunits, rhs->lsu, D2U(rhs->digits),
4723 /* now restore the remainder by dividing by two; the lsu */
4765 rhs->lsu, D2U(rhs->digits),
4992 for (count=lhs->digits, cup=lhs->lsu, lip=zlhi; count>0; lip++)
4997 for (count=rhs->digits, cup=rhs->lsu, rip=zrhi; count>0; rip++)
5083 /* is no advantage in calculating from msu to lsu. So, do it */
5087 *acc=0; /* .. (lsu=0) */
5090 mermsup=rhs->lsu+D2U(rhs->digits); /* -> msu+1 of multiplier */
5092 for (mer=rhs->lsu; mer<mermsup; mer++) {
5096 lhs->lsu, madlength, 0,
5279 *res->lsu=1; /* .. */
5297 *d->lsu=4; /* set 4 .. */
5307 *res->lsu=1; /* .. */
5308 res->digits=decShiftToMost(res->lsu, 1, shift);
5334 *a->lsu=2; /* not 1 but < exp(1) */
5415 uprv_decNumberZero(a); *a->lsu=1; /* accumulator=1 */
5416 uprv_decNumberZero(d); *d->lsu=2; /* divisor=2 */
5417 uprv_decNumberZero(&numone); *numone.lsu=1; /* constant 1 for increment */
5466 uprv_decNumberZero(t); *t->lsu=1; /* acc=1 */
5640 if (rhs->lsu[0]==0 && rhs->lsu[1]==1 && rhs->digits==2) { /* ln(10) */
5642 if (rhs->lsu[0]==10 && rhs->digits==2) { /* ln(10) */
5649 if (rhs->lsu[0]==2 && rhs->digits==1) { /* ln(2) */
5721 uprv_decNumberZero(&numone); *numone.lsu=1; /* constant 1 for adjustment */
5770 if (cmp.lsu[0]==0) a->exponent=0; /* yes, exact 0 */
5935 res->digits=decShiftToMost(res->lsu, res->digits, 1); /* shift */
5949 res->digits=decShiftToMost(res->lsu, res->digits, -adjust);
6065 result=decUnitCompare(lhs->lsu, D2U(lhs->digits),
6066 rhs->lsu, D2U(rhs->digits), 0);
6107 *res->lsu=1;
6209 compare=decUnitCompare(lhs->lsu, D2U(lhs->digits),
6210 rhs->lsu, D2U(rhs->digits),
6223 /* Arg1 is A first Unit (lsu) */
6225 /* Arg3 is B first Unit (lsu) */
6308 /* C is filled from the lsu; only those units necessary to complete */
6311 /* Arg1 is A first Unit (lsu) */
6313 /* Arg3 is B first Unit (lsu) */
6316 /* Arg6 is C first Unit (lsu) */
6340 const Unit *alsu=a; /* A lsu [need to remember it] */
6603 || (*dn->lsu & 0x01)) return dn; /* .. or odd */
6612 up=dn->lsu; /* -> current Unit */
6645 decShiftToLeast(dn->lsu, D2U(dn->digits), d);
6733 /* shift is the number of digits to remove from the lsu end; it */
6847 decSetCoeff(dest, set, src->lsu, src->digits, residue, status);
6856 /* lsu -> lsu of the source coefficient [may be dn->lsu] */
6866 /* external intermediate array. If it is in the number, lsu must == */
6867 /* dn->lsu and len must == dn->digits. */
6871 /* if dn->lsu==lsu). */
6878 /* dn->digits, dn->lsu (and as required), and dn->exponent are */
6889 static void decSetCoeff(decNumber *dn, decContext *set, const Unit *lsu,
6902 if (dn->lsu!=lsu) { /* copy needed */
6905 up=lsu;
6906 for (target=dn->lsu; count>0; target++, up++, count-=DECDPUN)
6925 for (up=lsu; count>0; up++, count-=DECDPUN) if (*up!=0) { /* found non-0 */
6931 *dn->lsu=0; /* coefficient will now be 0 */
6943 for (up=lsu;; up++) {
6962 *dn->lsu=0; /* .. result is 0 */
6970 for (target=dn->lsu; count>0; target++, up++, count-=DECDPUN)
7007 *dn->lsu=0; /* .. result is 0 */
7014 for (target=dn->lsu; ; target++) {
7087 Int lsd5=*dn->lsu%5; /* get lsd and quintate */
7106 if (*dn->lsu & 0x01) bump=1;
7159 for (up=dn->lsu; ; up++) {
7165 for (up=up-1; up>=dn->lsu; up--) *up=0; /* others all to 0 */
7183 for (up=dn->lsu; ; up++) {
7191 for (up=up-1; up>=dn->lsu; up--) *up=(Unit)powers[DECDPUN]-1;
7219 decUnitAddSub(dn->lsu, D2U(dn->digits), uarrone, 1, 0, dn->lsu, bump);
7250 dn->digits=decShiftToMost(dn->lsu, dn->digits, dn->exponent);
7296 nmin.lsu[0]=1;
7330 dn->digits=decShiftToMost(dn->lsu, dn->digits, shift);
7399 for (up=dn->lsu; ; up++) {
7478 decSetCoeff(dn, &workset, dn->lsu, dn->digits, residue, status);
7488 dn->digits=decShiftToMost(dn->lsu, dn->digits, 1);
7559 up=dn->lsu; /* ready for lsu */
7592 if (got==0) {theInt=*up; got+=DECDPUN; up++;} /* ensure lsu is there */
7629 /* which will also be removed). Only dn->lsu and dn->digits change. */
7640 dn->lsu[0]=0;
7644 msu=dn->lsu+D2U(dn->digits-drop)-1; /* -> likely msu */
7648 dn->digits=decGetDigits(dn->lsu, msu-dn->lsu+1);
7712 uresp1=res->lsu+D2U(set->digits);
7713 for (ur=res->lsu, ul=lhs->lsu; ur<uresp1; ur++, ul++) *ur=*ul;
7830 if (dn->exponent==0 && dn->digits==1 && *dn->lsu==0) {
7838 up=dn->lsu+D2U(dn->digits)-1; /* msu */
7840 for (up=up-1; up>=dn->lsu; up--) {
7985 if (*dn->lsu!=0) {
7987 printf("LSU %ld (not 0) for an infinity.\n", (LI)*dn->lsu);
7989 decDumpAr('I', dn->lsu, D2U(dn->digits));
8006 for (up=dn->lsu; d>0; up++) {
8020 (LI)*up, (LI)dn->digits, (LI)(up-dn->lsu), (LI)maxuint);