Lines Matching full:dn
70 /* dn is the source number (assumed valid) */
83 decimal128 * decimal128FromNumber(decimal128 *d128, const decNumber *dn, in decimal128FromNumber() argument
102 ae=dn->exponent+dn->digits-1; /* [0 if special] */ in decimal128FromNumber()
103 if (dn->digits>DECIMAL128_Pmax /* too many digits */ in decimal128FromNumber()
108 decNumberPlus(&dw, dn, &dc); /* (round and check) */ in decimal128FromNumber()
110 dw.bits|=dn->bits&DECNEG; in decimal128FromNumber()
112 dn=&dw; /* use the work number */ in decimal128FromNumber()
115 if (dn->bits&DECSPECIAL) { /* a special value */ in decimal128FromNumber()
116 if (dn->bits&DECINF) targhi=DECIMAL_Inf<<24; in decimal128FromNumber()
118 if ((*dn->lsu!=0 || dn->digits>1) /* non-zero coefficient */ in decimal128FromNumber()
119 && (dn->digits<DECIMAL128_Pmax)) { /* coefficient fits */ in decimal128FromNumber()
120 decDigitsToDPD(dn, targar, 0); in decimal128FromNumber()
122 if (dn->bits&DECNAN) targhi|=DECIMAL_NaN<<24; in decimal128FromNumber()
128 if (decNumberIsZero(dn)) { /* is a zero */ in decimal128FromNumber()
130 if (dn->exponent<-DECIMAL128_Bias) { in decimal128FromNumber()
135 exp=dn->exponent+DECIMAL128_Bias; /* bias exponent */ in decimal128FromNumber()
147 /* the dn is known to fit, but it may need to be padded */ in decimal128FromNumber()
148 exp=(uInt)(dn->exponent+DECIMAL128_Bias); /* bias exponent */ in decimal128FromNumber()
156 decDigitsToDPD(dn, targar, pad); in decimal128FromNumber()
169 if (dn->bits&DECNEG) targhi|=0x80000000; /* add sign bit */ in decimal128FromNumber()
194 /* dn is the target number, with appropriate space */
197 decNumber * decimal128ToNumber(const decimal128 *d128, decNumber *dn) { in decimal128ToNumber() argument
226 decNumberZero(dn); /* clean number */ in decimal128ToNumber()
227 if (sourhi&0x80000000) dn->bits=DECNEG; /* set sign if negative */ in decimal128ToNumber()
234 dn->bits|=DECINF; in decimal128ToNumber()
235 return dn; /* no coefficient needed */ in decimal128ToNumber()
237 else if (sourhi&0x02000000) dn->bits|=DECSNAN; in decimal128ToNumber()
238 else dn->bits|=DECNAN; in decimal128ToNumber()
242 dn->exponent=(exp<<12)+((sourhi>>14)&0xfff)-DECIMAL128_Bias; /* unbiased */ in decimal128ToNumber()
256 else return dn; /* easy: coefficient is 0 */ in decimal128ToNumber()
259 decDigitsFromDPD(dn, sourar, need); /* process declets */ in decimal128ToNumber()
260 /* decNumberShow(dn); */ in decimal128ToNumber()
261 return dn; in decimal128ToNumber()
279 decNumber dn; /* work */ in decimal128ToEngString() local
280 decimal128ToNumber(d128, &dn); in decimal128ToEngString()
281 decNumberToEngString(&dn, string); in decimal128ToEngString()
464 decNumber dn; /* .. */ in decimal128FromString() local
469 decNumberFromString(&dn, string, &dc); /* will round if needed */ in decimal128FromString()
470 decimal128FromNumber(result, &dn, &dc); in decimal128FromString()
484 decNumber dn; /* work */ in decimal128IsCanonical() local
488 decimal128ToNumber(d128, &dn); in decimal128IsCanonical()
489 decimal128FromNumber(&canon, &dn, &dc);/* canon will now be canonical */ in decimal128IsCanonical()
501 decNumber dn; /* work */ in decimal128Canonical() local
504 decimal128ToNumber(d128, &dn); in decimal128Canonical()
505 decimal128FromNumber(result, &dn, &dc);/* result will now be canonical */ in decimal128Canonical()