#endif
} /* block */
- /* Loop to repair a non-canonical coefficent, as needed */
+ /* Loop to repair a non-canonical coefficient, as needed */
inword=DECWORDS-1; /* current input word */
uoff=0; /* bit offset of declet */
encode=DFWORD(result, inword);
const decFloat *dfr, decContext *set, uInt op) {
decFloat quotient; /* for remainders */
bcdnum num; /* for final conversion */
- uInt acc[DIVACCLEN]; /* coefficent in base-billion .. */
+ uInt acc[DIVACCLEN]; /* coefficient in base-billion .. */
uInt div[DIVOPLEN]; /* divisor in base-billion .. */
uInt quo[DIVOPLEN+1]; /* quotient in base-billion .. */
uByte bcdacc[(DIVOPLEN+1)*9+2]; /* for quotient in BCD, +1, +1 */
} /* 0/x */
/* [here, both operands are known to be finite and non-zero] */
- /* extract the operand coefficents into 'units' which are */
+ /* extract the operand coefficients into 'units' which are */
/* base-billion; the lhs is high-aligned in acc and the msu of both */
/* acc and div is at the right-hand end of array (offset length-1); */
/* the quotient can need one more unit than the operands as digits */
#if DECUSE64
uLong accl[MULACCLEN]; /* lazy accumulator (base-billion+) */
uLong *pl; /* work -> lazy accumulator */
- uInt acc[MULACCLEN]; /* coefficent in base-billion .. */
+ uInt acc[MULACCLEN]; /* coefficient in base-billion .. */
#else
uInt acc[MULACCLEN*2]; /* accumulator in base-billion .. */
#endif
#endif
/* Effect the multiplication */
- /* The multiplcation proceeds using MFC's lazy-carry resolution */
+ /* The multiplication proceeds using MFC's lazy-carry resolution */
/* algorithm from decNumber. First, the multiplication is */
/* effected, allowing accumulation of the partial products (which */
/* are in base-billion at each column position) into 64 bits */
const decFloat *dfl, const decFloat *dfr,
decContext *set) {
bcdnum num; /* for final conversion */
- uByte bcdacc[DECPMAX9*18+1]; /* for coefficent in BCD */
+ uByte bcdacc[DECPMAX9*18+1]; /* for coefficient in BCD */
if (DFISSPECIAL(dfl) || DFISSPECIAL(dfr)) { /* either is special? */
/* NaNs are handled as usual */
} /* inexact rounding */
/* now clear zeros to the left so exactly DECPMAX digits will be */
- /* available in the coefficent -- the first word to the left was */
+ /* available in the coefficient -- the first word to the left was */
/* cleared earlier for safe carry; now add any more needed */
if (drop>4) {
UBFROMUI(BUFOFF-8, 0); /* must be at least 5 */
ulsd=BUFOFF+DECPMAX-1;
}
else { /* padding will fit (but may still be too long) */
- /* final-word mask depends on endianess */
+ /* final-word mask depends on endianness */
#if DECLITEND
static const uInt dmask[]={0, 0x000000ff, 0x0000ffff, 0x00ffffff};
#else
set->status|=DEC_Invalid_operation; /* Invalid or out of range */
return 0;
}
- /* get last twelve digits of the coefficent into hi & ho, base */
+ /* get last twelve digits of the coefficient into hi & ho, base */
/* 10**9 (see GETCOEFFBILL): */
sourlo=DFWORD(&result, DECWORDS-1);
lo=DPD2BIN0[sourlo&0x3ff]
#if DECCHECK
Int clen=ulsd-umsd+1;
#if QUAD
- #define COEXTRA 2 /* extra-long coefficent */
+ #define COEXTRA 2 /* extra-long coefficient */
#else
#define COEXTRA 0
#endif
uInt uiwork; /* for macros */
bcdnum num; /* collects data for finishing */
uInt error=DEC_Conversion_syntax; /* assume the worst */
- uByte buffer[ROUNDUP(DECSTRING+11, 8)]; /* room for most coefficents, */
+ uByte buffer[ROUNDUP(DECSTRING+11, 8)]; /* room for most coefficients, */
/* some common rounding, +3, & pad */
#if DECTRACE
/* printf("FromString %s ...\n", string); */
/* */
/* Addition, especially x=x+1, is speed-critical. */
/* The static buffer is larger than might be expected to allow for */
-/* calls from higher-level funtions (notable exp). */
+/* calls from higher-level functions (notable exp). */
/* ------------------------------------------------------------------ */
static decNumber * decAddOp(decNumber *res, const decNumber *lhs,
const decNumber *rhs, decContext *set,
/* long subtractions. These are acc and var1 respectively. */
/* var1 is a copy of the lhs coefficient, var2 is the rhs coefficient.*/
/* The static buffers may be larger than might be expected to allow */
-/* for calls from higher-level funtions (notable exp). */
+/* for calls from higher-level functions (notable exp). */
/* ------------------------------------------------------------------ */
static decNumber * decDivideOp(decNumber *res,
const decNumber *lhs, const decNumber *rhs,
/* would certainly save at least one if it were made ten times */
/* bigger, too (for truncated fractions 0.100 through 0.999). */
/* However, for most practical evaluations, at least four or five */
-/* iterations will be neede -- so this would only speed up by */
+/* iterations will be needed -- so this would only speed up by */
/* 20-25% and that probably does not justify increasing the table */
/* size. */
/* */
uInt uiwork; /* for macros */
alloc=malloc(size); /* -> allocated storage */
- if (alloc==NULL) return NULL; /* out of strorage */
+ if (alloc==NULL) return NULL; /* out of storage */
b0=(uByte *)alloc; /* as bytes */
decAllocBytes+=n; /* account for storage */
UBFROMUI(alloc, n); /* save n */