Lines Matching refs:residue
529 Int residue; /* rounding residue */ in uprv_decNumberFromString() local
723 residue=0; in uprv_decNumberFromString()
724 decSetCoeff(dn, set, res, d, &residue, &status); in uprv_decNumberFromString()
726 decFinalize(dn, set, &residue, &status); in uprv_decNumberFromString()
732 residue=0; in uprv_decNumberFromString()
733 decFinalize(dn, set, &residue, &status); in uprv_decNumberFromString()
1467 Int residue=0; /* (no residue) */ in uprv_decNumberLog10() local
1472 decCopyFit(w, rhs, &aset, &residue, ©stat); /* copy & shorten */ in uprv_decNumberLog10()
1480 residue=0; in uprv_decNumberLog10()
1481 decCopyFit(res, w, set, &residue, &status); /* copy & round */ in uprv_decNumberLog10()
1482 decFinish(res, set, &residue, &status); /* cleanup/set flags */ in uprv_decNumberLog10()
1993 Int residue=0; /* rounding residue */ in uprv_decNumberPower() local
2266 decFinalize(dac, set, &residue, &status); in uprv_decNumberPower()
2281 decCopyFit(res, dac, set, &residue, &status); in uprv_decNumberPower()
2282 decFinish(res, set, &residue, &status); /* final cleanup */ in uprv_decNumberPower()
2350 Int residue=0; /* as usual */ in uprv_decNumberReduce() local
2377 decCopyFit(res, rhs, set, &residue, &status); /* copy & round */ in uprv_decNumberReduce()
2378 decFinish(res, set, &residue, &status); /* cleanup/set flags */ in uprv_decNumberReduce()
2647 Int residue; /* work */ in uprv_decNumberScaleB() local
2670 residue=0; in uprv_decNumberScaleB()
2671 decFinalize(res, set, &residue, &status); /* .. and check */ in uprv_decNumberScaleB()
2839 Int residue=0; /* rounding residue */ in uprv_decNumberSquareRoot() local
2905 decFinish(res, set, &residue, &status); in uprv_decNumberSquareRoot()
3025 residue=0; /* .. and accumulator */ in uprv_decNumberSquareRoot()
3026 decCopyFit(a, a, &approxset, &residue, &rstatus); /* reduce (if needed) */ in uprv_decNumberSquareRoot()
3027 decFinish(a, &approxset, &residue, &rstatus); /* clean and finalize */ in uprv_decNumberSquareRoot()
3846 Int residue; /* rounding accumulator */ in decAddOp() local
3908 residue=0; /* clear accumulator */ in decAddOp()
3909 decCopyFit(res, rhs, set, &residue, status); /* copy (as needed) */ in decAddOp()
3937 decFinish(res, set, &residue, status); /* clean and finalize */ in decAddOp()
3944 residue=0; /* clear accumulator */ in decAddOp()
3945 decCopyFit(res, lhs, set, &residue, status); /* copy (as needed) */ in decAddOp()
3963 decFinish(res, set, &residue, status); /* clean and finalize */ in decAddOp()
4038 residue=1; /* residue for rounding */ in decAddOp()
4039 if (diffsign) residue=-residue; /* signs differ */ in decAddOp()
4041 decCopyFit(res, rhs, set, &residue, status); in decAddOp()
4049 decFinish(res, set, &residue, status); /* done */ in decAddOp()
4112 residue=0; /* clear accumulator */ in decAddOp()
4121 decSetCoeff(res, set, acc, res->digits, &residue, status); in decAddOp()
4143 decSetCoeff(res, set, acc, res->digits, &residue, status); in decAddOp()
4146 if (residue!=0) { in decAddOp()
4147 decApplyRound(res, set, residue, status); in decAddOp()
4148 residue=0; /* did what needed to be done */ in decAddOp()
4158 decFinish(res, set, &residue, status); in decAddOp()
4283 Int residue; /* for rounding */ in decDivideOp() local
4339 residue=0; in decDivideOp()
4342 decCopyFit(res, lhs, set, &residue, status); in decDivideOp()
4354 decFinish(res, set, &residue, status); in decDivideOp()
4382 residue=0; in decDivideOp()
4387 decFinalize(res, set, &residue, status); /* check exponent */ in decDivideOp()
4426 residue=0; in decDivideOp()
4427 decCopyFit(res, lhs, set, &residue, status); in decDivideOp()
4428 decFinish(res, set, &residue, status); in decDivideOp()
4650 residue=0; /* assume no residue */ in decDivideOp()
4653 if (*var1!=0 || var1units>1) residue=1; in decDivideOp()
4711 decFinish(res, set, &residue, status); /* might clamp */ in decDivideOp()
4816 decSetCoeff(res, set, accnext, accdigits, &residue, status); in decDivideOp()
4818 decFinish(res, set, &residue, status); /* final cleanup */ in decDivideOp()
4877 Int residue=0; /* rounding residue */ in decMultiplyOp() local
5171 decSetCoeff(res, set, acc, res->digits, &residue, status); in decMultiplyOp()
5172 decFinish(res, set, &residue, status); /* final cleanup */ in decMultiplyOp()
5271 Int residue; /* rounding residue */ in decExpOp() local
5524 residue=1; /* indicate dirt to right .. */ in decExpOp()
5525 if (ISZERO(a)) residue=0; /* .. unless underflowed to 0 */ in decExpOp()
5527 decCopyFit(res, a, &aset, &residue, status); /* copy & shorten */ in decExpOp()
5528 decFinish(res, set, &residue, status); /* cleanup/set flags */ in decExpOp()
5634 Int residue; /* rounding residue */ local
5748 residue=0; /* (no residue) */
5750 decCopyFit(b, rhs, &aset, &residue, &ignore); /* copy & shorten */
5839 residue=1; /* indicate dirt to right */
5840 if (ISZERO(a)) residue=0; /* .. unless underflowed to 0 */
5842 decCopyFit(res, a, &aset, &residue, status); /* copy & shorten */
5843 decFinish(res, set, &residue, status); /* cleanup/set flags */
5887 Int residue=0; /* rounding residue */ local
5968 decCopyFit(res, lhs, &workset, &residue, status); /* fit to result */
5969 decApplyRound(res, &workset, residue, status); /* .. and round */
5970 residue=0; /* [used] */
6008 decFinalize(res, set, &residue, status); /* set subnormal flags */
6159 Int residue=0; /* rounding accumulator */ local
6192 decCopyFit(res, choice, set, &residue, status);
6193 decFinish(res, set, &residue, status);
6857 Int residue=0; /* rounding accumulator */ local
6867 decCopyFit(res, dn, set, &residue, &newstatus);
6868 decApplyRound(res, set, residue, &newstatus);
6890 decContext *set, Int *residue, uInt *status) { argument
6893 decSetCoeff(dest, set, src->lsu, src->digits, residue, status);
6936 Int len, Int *residue, uInt *status) { argument
6957 if (*residue!=0) *status|=(DEC_Inexact | DEC_Rounded);
6964 if (*residue>1) *residue=1; /* previous residue now to right, so reduce */
6969 if (*residue<=0) { /* not already positive */
6972 *residue=1;
6976 if (*residue!=0) *status|=DEC_Inexact; /* record inexactitude */
6992 if (*up!=0) *residue=1;
7001 if (*up>half) *residue=7;
7002 else *residue+=5; /* add sticky bit */
7005 if (*up!=0) *residue=3; /* [else is 0, leave as sticky bit] */
7034 if (rem!=0) *residue=1;
7048 *residue+=resmap[discard1];
7081 if (*residue!=0) *status|=DEC_Inexact; /* record inexactitude */
7117 static void decApplyRound(decNumber *dn, decContext *set, Int residue, argument
7122 if (residue==0) return; /* nothing to apply */
7135 if (residue<0 && lsd5!=1) bump=-1;
7136 else if (residue>0 && lsd5==0) bump=1;
7142 if (residue<0) bump=-1;
7146 if (residue>5) bump=1;
7150 if (residue>5) bump=1; /* >0.5 goes up */
7151 else if (residue==5) { /* exactly 0.5000... */
7158 if (residue>=5) bump=1;
7162 if (residue>0) bump=1;
7169 if (residue<0) bump=-1;
7172 if (residue>0) bump=1;
7180 if (residue<0) bump=-1;
7183 if (residue>0) bump=1;
7286 static void decFinish(decNumber *dn, decContext *set, Int *residue, argument
7303 decFinalize(dn, set, residue, status);
7321 static void decFinalize(decNumber *dn, decContext *set, Int *residue, argument
7338 decSetSubnormal(dn, set, residue, status);
7350 if (*residue<0 && comp==0) { /* neg residue and dn==Nmin */
7351 decApplyRound(dn, set, *residue, status); /* might force down */
7352 decSetSubnormal(dn, set, residue, status);
7358 if (*residue!=0) decApplyRound(dn, set, *residue, status);
7475 static void decSetSubnormal(decNumber *dn, decContext *set, Int *residue, argument
7497 if (*residue!=0) {
7498 printf("++ Subnormal 0 residue %ld\n", (LI)*residue);
7525 decSetCoeff(dn, &workset, dn->lsu, dn->digits, residue, status);
7526 decApplyRound(dn, &workset, *residue, status);