Lines Matching refs:lsu
165 /* lsu -- least significant Unit (of coefficient) */
362 for (up=dn->lsu; uin>0; up++) {
366 dn->digits=decGetDigits(dn->lsu, up-dn->lsu);
391 up=dn->lsu; /* -> lsu */
427 up=dn->lsu; /* -> lsu */
651 if (d<=set->digits) res=dn->lsu; /* fits into supplied decNumber */
661 /* res now -> number lsu, buffer, or allocated storage for Unit array */
680 *up=(Unit)out; /* write lsu */
684 up=res; /* -> lsu */
813 ua=lhs->lsu; /* bottom-up */
814 ub=rhs->lsu; /* .. */
815 uc=res->lsu; /* .. */
846 res->digits=decGetDigits(res->lsu, uc-res->lsu);
1208 ua=rhs->lsu; /* bottom-up */
1209 uc=res->lsu; /* .. */
1233 res->digits=decGetDigits(res->lsu, uc-res->lsu);
1445 if (!(copystat&DEC_Inexact) && w->lsu[0]==1) {
1499 w->lsu[1]=1; w->lsu[0]=0; /* .. */
1501 w->lsu[0]=10; /* .. */
1677 dtiny.lsu[0]=1; /* make number that is .. */
1714 dtiny.lsu[0]=1; /* make number that is .. */
1777 dtiny.lsu[0]=1; /* make number that is .. */
1821 ua=lhs->lsu; /* bottom-up */
1822 ub=rhs->lsu; /* .. */
1823 uc=res->lsu; /* .. */
1853 res->digits=decGetDigits(res->lsu, uc-res->lsu);
2005 dnOne.lsu[0]=1;
2011 else if (dac->lsu[0]==0) { /* lhs=1 */
2014 *res->lsu=1; /* was 0, make int 1 */
2015 res->digits=decShiftToMost(res->lsu, 1, shift);
2043 if (n==0) *res->lsu=1; /* [-]Inf**0 => 1 */
2061 *res->lsu=1; /* return 1 */
2115 *res->lsu=1; /* .. */
2152 *dac->lsu=1; /* was 0, make int 1 */
2155 dac->digits=decShiftToMost(dac->lsu, 1, shift);
2169 *dac->lsu=1; /* .. */
2485 Unit *msu=res->lsu+D2U(res->digits)-1; /* current msu */
2486 Unit *msumax=res->lsu+D2U(set->digits)-1; /* rotation msu */
2526 uInt save=res->lsu[0]%powers[shift]; /* save low digit(s) */
2527 decShiftToLeast(res->lsu, D2U(res->digits), shift);
2546 uInt save=res->lsu[0]%powers[shift]; /* save low digit(s) */
2547 decShiftToLeast(res->lsu, units, shift);
2553 decReverse(res->lsu+units, msumax); /* left part */
2554 decReverse(res->lsu, res->lsu+units-1); /* right part */
2555 decReverse(res->lsu, msumax); /* whole */
2559 res->digits=decGetDigits(res->lsu, msumax-res->lsu+1);
2592 *res->lsu=ret;
2694 *res->lsu=0; /* so place 0 */
2704 if (res->digits>1 || *res->lsu) /* if non-zero.. */
2705 res->digits=decShiftToMost(res->lsu, res->digits, shift);
2710 *res->lsu=0; /* so place 0 */
2714 decShiftToLeast(res->lsu, D2U(res->digits), -shift);
2932 t->lsu[0]=259;
2933 a->lsu[0]=819;
2935 t->lsu[0]=59; t->lsu[1]=2;
2936 a->lsu[0]=19; a->lsu[1]=8;
2938 t->lsu[0]=9; t->lsu[1]=5; t->lsu[2]=2;
2939 a->lsu[0]=9; a->lsu[1]=1; a->lsu[2]=8;
2949 t->lsu[0]=819;
2950 a->lsu[0]=259;
2952 t->lsu[0]=19; t->lsu[1]=8;
2953 a->lsu[0]=59; a->lsu[1]=2;
2955 t->lsu[0]=9; t->lsu[1]=1; t->lsu[2]=8;
2956 a->lsu[0]=9; a->lsu[1]=5; a->lsu[2]=2;
2968 t->lsu[0]=5; /* .. */
3021 t->lsu[0]=1; /* .. */
3035 t->lsu[0]=1; /* .. */
3088 decShiftToLeast(a->lsu, D2U(a->digits), todrop);
3244 ua=lhs->lsu; /* bottom-up */
3245 ub=rhs->lsu; /* .. */
3246 uc=res->lsu; /* .. */
3276 res->digits=decGetDigits(res->lsu, uc-res->lsu);
3355 /* more than just the lsu (for small DECDPUN). This would not affect */
3361 dest->lsu[0]=src->lsu[0];
3367 d=dest->lsu+1; /* -> first destination */
3368 smsup=src->lsu+D2U(src->digits); /* -> source msu+1 */
3369 for (s=src->lsu+1; s<smsup; s++, d++) *d=*s;
3453 const Unit *up=dn->lsu; /* Unit pointer, -> lsu */
3486 Unit *up=dn->lsu+D2U(dn->digits)-1; /* -> msu [target pointer] */
3494 for (;up>=dn->lsu; up--) { /* each Unit from msu */
3591 dn->lsu[0]=0;
3621 const Unit *up=dn->lsu+D2U(dn->digits)-1; /* -> msu [input pointer] */
3648 if (exp!=0 || (*dn->lsu==0 && dn->digits==1)) return;
3657 for (;up>=dn->lsu; up--) { /* each Unit from msu */
3702 if (up==dn->lsu) break; /* out of input digits (pre>digits) */
3713 if (up==dn->lsu) break; /* out of input digits */
3729 if (up==dn->lsu) break; /* out of input digits */
3891 res->digits=decShiftToMost(res->lsu, res->digits, -adjust);
3918 res->digits=decShiftToMost(res->lsu, res->digits, -adjust);
3942 Int partial=*lhs->lsu;
3944 partial+=*rhs->lsu;
3949 *res->lsu=(Unit)partial; /* [copy could have overwritten RHS] */
3955 partial-=*rhs->lsu;
3958 *res->lsu=(Unit)partial;
3960 res->digits=decGetDigits(res->lsu, D2U(res->digits));
4005 res->digits=decShiftToMost(res->lsu, res->digits, shift);
4026 acc=res->lsu; /* assume add direct to result */
4050 lsu, D2U(lhs->digits));
4051 decDumpAr('B', rhs->lsu, D2U(rhs->digits));
4056 res->digits=decUnitAddSub(lhs->lsu, D2U(lhs->digits),
4057 rhs->lsu, D2U(rhs->digits),
4072 if (acc!=res->lsu) {
4114 res->digits=decGetDigits(res->lsu, D2U(res->digits));
4440 source=lhs->lsu+D2U(lhs->digits)-1; /* msu of input array */
4441 for (target=msu1; source>=lhs->lsu; source--, target--) *target=*source;
4447 var2=rhs->lsu; /* -> rhs array */
4539 /* The var2 msu is one unit towards the lsu of the var1 msu, */
4598 /* if early stop), starting at accnext+1 (its lsu) */
4619 Unit lsu=*accnext;
4620 if (!(lsu&0x01) && (lsu!=0)) {
4623 for (;; drop++) { /* [will terminate because lsu!=0] */
4626 if ((lsu-QUOT10(lsu, drop+1)
4629 if (lsu%powers[drop+1]!=0) break; /* found non-0 digit */
4711 compare=decUnitCompare(accnext, tarunits, rhs->lsu, D2U(rhs->digits),
4717 /* now restore the remainder by dividing by two; the lsu */
4759 rhs->lsu, D2U(rhs->digits),
4986 for (count=lhs->digits, cup=lhs->lsu, lip=zlhi; count>0; lip++)
4991 for (count=rhs->digits, cup=rhs->lsu, rip=zrhi; count>0; rip++)
5077 /* is no advantage in calculating from msu to lsu. So, do it */
5081 *acc=0; /* .. (lsu=0) */
5084 mermsup=rhs->lsu+D2U(rhs->digits); /* -> msu+1 of multiplier */
5086 for (mer=rhs->lsu; mer<mermsup; mer++) {
5090 lhs->lsu, madlength, 0,
5273 *res->lsu=1; /* .. */
5291 *d->lsu=4; /* set 4 .. */
5301 *res->lsu=1; /* .. */
5302 res->digits=decShiftToMost(res->lsu, 1, shift);
5328 *a->lsu=2; /* not 1 but < exp(1) */
5409 decNumberZero(a); *a->lsu=1; /* accumulator=1 */
5410 decNumberZero(d); *d->lsu=2; /* divisor=2 */
5411 decNumberZero(&numone); *numone.lsu=1; /* constant 1 for increment */
5460 decNumberZero(t); *t->lsu=1; /* acc=1 */
5634 if (rhs->lsu[0]==0 && rhs->lsu[1]==1 && rhs->digits==2) { /* ln(10) */
5636 if (rhs->lsu[0]==10 && rhs->digits==2) { /* ln(10) */
5643 if (rhs->lsu[0]==2 && rhs->digits==1) { /* ln(2) */
5715 decNumberZero(&numone); *numone.lsu=1; /* constant 1 for adjustment */
5764 if (cmp.lsu[0]==0) a->exponent=0; /* yes, exact 0 */
5929 res->digits=decShiftToMost(res->lsu, res->digits, 1); /* shift */
5943 res->digits=decShiftToMost(res->lsu, res->digits, -adjust);
6059 result=decUnitCompare(lhs->lsu, D2U(lhs->digits),
6060 rhs->lsu, D2U(rhs->digits), 0);
6101 *res->lsu=1;
6203 compare=decUnitCompare(lhs->lsu, D2U(lhs->digits),
6204 rhs->lsu, D2U(rhs->digits),
6217 /* Arg1 is A first Unit (lsu) */
6219 /* Arg3 is B first Unit (lsu) */
6302 /* C is filled from the lsu; only those units necessary to complete */
6305 /* Arg1 is A first Unit (lsu) */
6307 /* Arg3 is B first Unit (lsu) */
6310 /* Arg6 is C first Unit (lsu) */
6334 const Unit *alsu=a; /* A lsu [need to remember it] */
6597 || (*dn->lsu & 0x01)) return dn; /* .. or odd */
6606 up=dn->lsu; /* -> current Unit */
6639 decShiftToLeast(dn->lsu, D2U(dn->digits), d);
6727 /* shift is the number of digits to remove from the lsu end; it */
6841 decSetCoeff(dest, set, src->lsu, src->digits, residue, status);
6850 /* lsu -> lsu of the source coefficient [may be dn->lsu] */
6860 /* external intermediate array. If it is in the number, lsu must == */
6861 /* dn->lsu and len must == dn->digits. */
6865 /* if dn->lsu==lsu). */
6872 /* dn->digits, dn->lsu (and as required), and dn->exponent are */
6883 static void decSetCoeff(decNumber *dn, decContext *set, const Unit *lsu,
6896 if (dn->lsu!=lsu) { /* copy needed */
6899 up=lsu;
6900 for (target=dn->lsu; count>0; target++, up++, count-=DECDPUN)
6919 for (up=lsu; count>0; up++, count-=DECDPUN) if (*up!=0) { /* found non-0 */
6925 *dn->lsu=0; /* coefficient will now be 0 */
6937 for (up=lsu;; up++) {
6956 *dn->lsu=0; /* .. result is 0 */
6964 for (target=dn->lsu; count>0; target++, up++, count-=DECDPUN)
7001 *dn->lsu=0; /* .. result is 0 */
7008 for (target=dn->lsu; ; target++) {
7081 Int lsd5=*dn->lsu%5; /* get lsd and quintate */
7100 if (*dn->lsu & 0x01) bump=1;
7153 for (up=dn->lsu; ; up++) {
7159 for (up=up-1; up>=dn->lsu; up--) *up=0; /* others all to 0 */
7177 for (up=dn->lsu; ; up++) {
7185 for (up=up-1; up>=dn->lsu; up--) *up=(Unit)powers[DECDPUN]-1;
7213 decUnitAddSub(dn->lsu, D2U(dn->digits), uarrone, 1, 0, dn->lsu, bump);
7244 dn->digits=decShiftToMost(dn->lsu, dn->digits, dn->exponent);
7290 nmin.lsu[0]=1;
7324 dn->digits=decShiftToMost(dn->lsu, dn->digits, shift);
7393 for (up=dn->lsu; ; up++) {
7472 decSetCoeff(dn, &workset, dn->lsu, dn->digits, residue, status);
7482 dn->digits=decShiftToMost(dn->lsu, dn->digits, 1);
7553 up=dn->lsu; /* ready for lsu */
7586 if (got==0) {theInt=*up; got+=DECDPUN; up++;} /* ensure lsu is there */
7623 /* which will also be removed). Only dn->lsu and dn->digits change. */
7634 dn->lsu[0]=0;
7638 msu=dn->lsu+D2U(dn->digits-drop)-1; /* -> likely msu */
7642 dn->digits=decGetDigits(dn->lsu, msu-dn->lsu+1);
7706 uresp1=res->lsu+D2U(set->digits);
7707 for (ur=res->lsu, ul=lhs->lsu; ur<uresp1; ur++, ul++) *ur=*ul;
7824 if (dn->exponent==0 && dn->digits==1 && *dn->lsu==0) {
7832 up=dn->lsu+D2U(dn->digits)-1; /* msu */
7834 for (up=up-1; up>=dn->lsu; up--) {
7979 if (*dn->lsu!=0) {
7981 printf("LSU %ld (not 0) for an infinity.\n", (LI)*dn->lsu);
7983 decDumpAr('I', dn->lsu, D2U(dn->digits));
8000 for (up=dn->lsu; d>0; up++) {
8014 (LI)*up, (LI)dn->digits, (LI)(up-dn->lsu), (LI)maxuint);