Lines Matching refs:Int
197 #define BADINT (Int)0x80000000 /* most-negative Int; error indicator */
199 #define BIGEVEN (Int)0x80000002
200 #define BIGODD (Int)0x80000003
206 #define eInt Int /* extended integer */
228 static void decApplyRound(decNumber *, decContext *, Int, uInt *);
229 static Int decCompare(const decNumber *lhs, const decNumber *rhs, Flag);
234 Int *, uInt *);
235 static decNumber * decDecap(decNumber *, Int);
240 static void decFinalize(decNumber *, decContext *, Int *, uInt *);
241 static Int decGetDigits(Unit *, Int);
242 static Int decGetInt(const decNumber *);
255 Int, Int *, uInt *);
258 static void decSetSubnormal(decNumber *, decContext *, Int *, uInt *);
259 static Int decShiftToLeast(Unit *, Int, Int);
260 static Int decShiftToMost(Unit *, Int, Int);
263 static decNumber * decTrim(decNumber *, decContext *, Flag, Int *);
264 static Int decUnitAddSub(const Unit *, Int, const Unit *, Int, Int,
265 Unit *, Int);
266 static Int decUnitCompare(const Unit *, Int, const Unit *, Int, Int);
273 static void decFinish(decNumber *, decContext *, Int *, uInt *);
322 static void decDumpAr(char, const Unit *, Int);
338 decNumber * decNumberFromInt32(decNumber *dn, Int in) { in decNumberFromInt32()
373 Int decNumberToInt32(const decNumber *dn, decContext *set) { in decNumberToInt32()
381 Int d; /* work */ in decNumberToInt32()
400 Int i=X10(hi)+lo; in decNumberToInt32()
417 Int d; /* work */ in decNumberToUInt32()
655 Int exponent=0; /* working exponent [assume 0] */ in decNumberFromString()
661 Int d=0; /* count of digits found in decimal part */ in decNumberFromString()
668 Int cut, out; /* .. */ in decNumberFromString()
670 Int residue; /* rounding residue */ in decNumberFromString()
773 exponent=X10(exponent)+(Int)*c-(Int)'0'; in decNumberFromString()
817 Int needbytes=D2U(d)*sizeof(Unit);/* bytes needed */ in decNumberFromString()
819 if (needbytes>(Int)sizeof(resbuff)) { /* too big for local */ in decNumberFromString()
835 out=X10(out)+(Int)*c-(Int)'0'; in decNumberFromString()
851 *up=(Unit)((Int)*c-(Int)'0'); in decNumberFromString()
965 Int msudigs; /* digits in res msu */ in decNumberAnd()
992 Int i, j; in decNumberAnd()
1362 Int msudigs; /* digits in res msu */ in decNumberInvert()
1379 Int i, j; /* work */ in decNumberInvert()
1514 Int ae=rhs->exponent+rhs->digits-1; /* adjusted exponent */ in decNumberLogB()
1557 Int p; /* working precision */ in decNumberLog10()
1558 Int t; /* digits in exponent of A */ in decNumberLog10()
1602 Int residue=0; /* (no residue) */ in decNumberLog10()
1904 Int result; /* .. */ in decNumberNextToward()
1973 Int msudigs; /* digits in res msu */ in decNumberOr()
1999 Int i, j; in decNumberOr()
2113 Int reqdigits=set->digits; /* requested DIGITS */ in decNumberPower()
2114 Int n; /* rhs in binary */ in decNumberPower()
2118 Int i; /* work */ in decNumberPower()
2120 Int dropped; /* .. */ in decNumberPower()
2124 Int residue=0; /* rounding residue */ in decNumberPower()
2176 Int shift=set->digits-1; in decNumberPower()
2317 Int shift=set->digits-1; in decNumberPower()
2481 Int residue=0; /* as usual */ in decNumberReduce()
2482 Int dropped; /* work */ in decNumberReduce()
2620 Int rotate; /* rhs as an Int */ in decNumberRotate()
2775 Int reqexp; /* requested exponent change [B] */ in decNumberScaleB()
2777 Int residue; /* work */ in decNumberScaleB()
2833 Int shift; /* rhs as an Int */ in decNumberShift()
2963 Int maxp; /* largest working precision */ in decNumberSquareRoot()
2964 Int workp; /* working precision */ in decNumberSquareRoot()
2965 Int residue=0; /* rounding residue */ in decNumberSquareRoot()
2968 Int exp; /* working exponent */ in decNumberSquareRoot()
2969 Int ideal; /* ideal (preferred) exponent */ in decNumberSquareRoot()
2970 Int needbytes; /* work */ in decNumberSquareRoot()
2971 Int dropped; /* .. */ in decNumberSquareRoot()
3052 if (needbytes>(Int)sizeof(buff)) { in decNumberSquareRoot()
3061 if (needbytes>(Int)sizeof(bufa)) { /* [same applies to b] */ in decNumberSquareRoot()
3234 Int todrop=ideal-a->exponent; /* most that can be dropped */ in decNumberSquareRoot()
3254 Int ae=rhs->exponent+rhs->digits-1; /* adjusted exponent */ in decNumberSquareRoot()
3387 Int msudigs; /* digits in res msu */ in decNumberXor()
3413 Int i, j; in decNumberXor()
3647 Int cut=MSUDIGITS(n); /* [faster than remainder] */ in decNumberSetBCD()
3664 Int decNumberIsNormal(const decNumber *dn, decContext *set) { in decNumberIsNormal()
3665 Int ae; /* adjusted exponent */ in decNumberIsNormal()
3684 Int decNumberIsSubnormal(const decNumber *dn, decContext *set) { in decNumberIsSubnormal()
3685 Int ae; /* adjusted exponent */ in decNumberIsSubnormal()
3708 Int dropped; /* work */ in decNumberTrim()
3769 Int exp=dn->exponent; /* local copy */ in decToString()
3770 Int e; /* E-part value */ in decToString()
3771 Int pre; /* digits before the '.' */ in decToString()
3772 Int cut; /* for counting digits in a Unit */ in decToString()
3825 Int adj; /* adjustment */ in decToString()
3852 Int n=pre; in decToString()
3957 Int rhsshift; /* working shift (in Units) */ in decAddOp()
3958 Int maxdigits; /* longest logical length */ in decAddOp()
3959 Int mult; /* multiplier */ in decAddOp()
3960 Int residue; /* rounding accumulator */ in decAddOp()
3968 Int reqdigits=set->digits; /* local copy; requested DIGITS */ in decAddOp()
3969 Int padding; /* work */ in decAddOp()
4019 Int adjust; /* work */ in decAddOp()
4020 Int lexp=lhs->exponent; /* save in case LHS==RES */ in decAddOp()
4055 Int adjust; /* work */ in decAddOp()
4056 Int rexp=rhs->exponent; /* save in case RHS==RES */ in decAddOp()
4095 Int partial=*lhs->lsu; in decAddOp()
4100 partial<(Int)powers[lhs->digits])) { /* .. */ in decAddOp()
4151 Int shift=reqdigits-rhs->digits; /* left shift needed */ in decAddOp()
4187 Int need=D2U(maxdigits)+1; in decAddOp()
4375 Int acclength; /* length of acc needed [Units] */ in decDivideOp()
4376 Int accunits; /* count of units accumulated */ in decDivideOp()
4377 Int accdigits; /* count of digits accumulated */ in decDivideOp()
4386 Int msu2plus; /* msu2 plus one [does not vary] */ in decDivideOp()
4389 Int var1units, var2units; /* actual lengths */ in decDivideOp()
4390 Int var2ulen; /* logical length (units) */ in decDivideOp()
4391 Int var1initpad=0; /* var1 initial padding (digits) */ in decDivideOp()
4392 Int maxdigits; /* longest LHS or required acc length */ in decDivideOp()
4393 Int mult; /* multiplier for subtraction */ in decDivideOp()
4395 Int residue; /* for rounding */ in decDivideOp()
4396 Int reqdigits=set->digits; /* requested DIGITS */ in decDivideOp()
4397 Int exponent; /* working exponent */ in decDivideOp()
4398 Int maxexponent=0; /* DIVIDE maximum exponent if unrounded */ in decDivideOp()
4403 Int shift, cut; /* .. */ in decDivideOp()
4405 Int dropped; /* work */ in decDivideOp()
4689 mult=(Int)(((eInt)*msu1*(DECDPUNMAX+1)+*(msu1-1))/msu2pair); in decDivideOp()
4694 mult=(Int)(((eInt)*msu1*(DECDPUNMAX+1)+*(msu1-1))/msu2plus); in decDivideOp()
4775 Int drop=0; in decDivideOp()
4805 Int postshift; /* work */ in decDivideOp()
4808 Int quotdigits; /* .. */ in decDivideOp()
4815 Int exp=lhs->exponent; /* save min(exponents) */ in decDivideOp()
4852 Int compare, tarunits; /* work */ in decDivideOp()
4873 Int half; /* half to add to lower unit */ in decDivideOp()
4882 Int exp, expunits, exprem; /* work */ in decDivideOp()
4913 expunits, accnext, -(Int)powers[exprem]); in decDivideOp()
4987 Int accunits; /* Units of accumulator in use */ in decMultiplyOp()
4988 Int exponent; /* work */ in decMultiplyOp()
4989 Int residue=0; /* rounding residue */ in decMultiplyOp()
4992 Int needbytes; /* size calculator */ in decMultiplyOp()
4997 Int madlength; /* Units in multiplicand */ in decMultiplyOp()
4998 Int shift; /* Units to shift multiplicand by */ in decMultiplyOp()
5025 Int zoff; /* accumulator offset */ in decMultiplyOp()
5029 Int ilhs, irhs, iacc; /* item counts in the arrays */ in decMultiplyOp()
5030 Int lazy; /* lazy carry counter */ in decMultiplyOp()
5033 Int count; /* work */ in decMultiplyOp()
5037 Int p; /* .. */ in decMultiplyOp()
5106 if (needbytes>(Int)sizeof(zlhibuff)) { in decMultiplyOp()
5110 if (needbytes>(Int)sizeof(zrhibuff)) { in decMultiplyOp()
5126 if (needbytes>(Int)sizeof(zaccbuff)) { in decMultiplyOp()
5222 if (needbytes>(Int)sizeof(accbuff)) { in decMultiplyOp()
5377 Int h; /* adjusted exponent for 0.xxxx */ in decExpOp()
5378 Int p; /* working precision */ in decExpOp()
5379 Int residue; /* rounding residue */ in decExpOp()
5383 Int comp; /* work */ in decExpOp()
5410 Int iterations=0; /* for later sanity check */ in decExpOp()
5452 Int shift=set->digits-1; in decExpOp()
5487 Int maxlever=(rhs->digits>8?1:0); in decExpOp()
5498 Int lever=MINI(8-h, maxlever); /* leverage attainable */ in decExpOp()
5499 Int use=-rhs->digits-lever; /* exponent to use for RHS */ in decExpOp()
5606 Int seenbit=0; /* set once a 1-bit is seen */ in decExpOp()
5607 Int i; /* counter */ in decExpOp()
5608 Int n=powers[h]; /* always positive */ in decExpOp()
5739 Int residue; /* rounding residue */
5740 Int r; /* rhs=f*10**r [see below] */
5741 Int p; /* working precision */
5742 Int pp; /* precision for iteration */
5743 Int t; /* work */
5759 Int iterations=0; /* for later sanity check */
5987 Int reqdigits=set->digits; /* requested DIGITS */
5988 Int reqexp; /* requested exponent [-scale] */
5989 Int residue=0; /* rounding residue */
5990 Int etiny=set->emin-(reqdigits-1);
6056 Int adjust=reqexp-lhs->exponent; /* digit adjustment needed */
6159 Int result=0; /* default result value */
6261 Int residue=0; /* rounding accumulator */
6317 static Int decCompare(const decNumber *lhs, const decNumber *rhs,
6319 Int result; /* result value */
6320 Int sigr; /* rhs signum */
6321 Int compare; /* work */
6381 static Int decUnitCompare(const Unit *a, Int alength,
6382 const Unit *b, Int blength, Int exp) {
6386 Int accunits, need; /* units in use or needed for acc */
6388 Int expunits, exprem, result; /* .. */
6405 if (alength>blength+(Int)D2U(exp)) return 1;
6406 if (alength+1<blength+(Int)D2U(exp)) return -1;
6425 -(Int)powers[exprem]);
6485 static Int decUnitAddSub(const Unit *a, Int alength,
6486 const Unit *b, Int blength, Int bshift,
6487 Unit *c, Int m) {
6493 Int add; /* work */
6495 Int est; /* estimated quotient */
6739 Int *dropped) {
6740 Int d, exp; /* work */
6786 Int maxd=set->emax-set->digits+1-dn->exponent;
6832 static Int decShiftToMost(Unit *uar, Int digits, Int shift) {
6834 Int cut; /* odd 0's to add */
6888 static Int decShiftToLeast(Unit *uar, Int units, Int shift) {
6890 Int cut, count; /* work */
6891 Int quot, rem; /* for division */
6958 Int residue=0; /* rounding accumulator */
6991 decContext *set, Int *residue, uInt *status) {
7037 Int len, Int *residue, uInt *status) {
7038 Int discard; /* number of digits to discard */
7042 Int count; /* .. */
7217 static void decApplyRound(decNumber *dn, decContext *set, Int residue,
7219 Int bump; /* 1 if coefficient needs to be incremented */
7234 Int lsd5=*dn->lsu%5; /* get lsd and quintate */
7386 static void decFinish(decNumber *dn, decContext *set, Int *residue,
7421 static void decFinalize(decNumber *dn, decContext *set, Int *residue,
7423 Int shift; /* shift needed if clamping */
7424 Int tinyexp=set->emin-dn->digits+1; /* precalculate subnormal boundary */
7433 Int comp;
7500 Int emax=set->emax; /* limit value */
7543 Int count=set->digits; /* nines to add */
7575 static void decSetSubnormal(decNumber *dn, decContext *set, Int *residue,
7578 Int etiny, adjust; /* .. */
7689 static Int decGetInt(const decNumber *dn) {
7690 Int theInt; /* result accumulator */
7692 Int got; /* digits (real or not) processed */
7693 Int ilength=dn->digits+dn->exponent; /* integral length */
7713 Int count=-dn->exponent; /* digits to discard */
7721 Int rem; /* work */
7742 Int save=theInt;
7749 if (theInt/(Int)powers[got-DECDPUN]!=(Int)*(up-1)) ilength=11;
7778 static decNumber *decDecap(decNumber *dn, Int drop) {
7780 Int cut; /* work */
7914 static Int decGetDigits(Unit *uar, Int len) {
7916 Int digits=(len-1)*DECDPUN+1; /* possible digits excluding msu */
7995 Int cut; /* .. */
8044 static void decDumpAr(char name, const Unit *ar, Int len) {
8045 Int i;
8138 Int ae, d, digits; /* .. */
8139 Int emin, emax; /* .. */
8313 b-b0-8, (Int)b0);
8316 b-b0-8, (Int)b0, n);