Lines Matching refs:df

85 static decFloat * decCanonical(decFloat *result, const decFloat *df) {  in decCanonical()  argument
89 if (df!=result) *result=*df; /* effect copy if needed */ in decCanonical()
91 if (DFISINF(result)) return decInfinity(result, df); /* clean Infinity */ in decCanonical()
94 if (DFISCCZERO(df)) return result; /* coefficient continuation is 0 */ in decCanonical()
100 uInt sourhi=DFWORD(df, 0); in decCanonical()
101 uInt sourlo=DFWORD(df, 1); in decCanonical()
108 uInt sourhi=DFWORD(df, 0); in decCanonical()
109 uInt sourmh=DFWORD(df, 1); in decCanonical()
110 uInt sourml=DFWORD(df, 2); in decCanonical()
111 uInt sourlo=DFWORD(df, 3); in decCanonical()
1079 decFloat * decFloatAbs(decFloat *result, const decFloat *df, in decFloatAbs() argument
1081 if (DFISNAN(df)) return decNaNs(result, df, NULL, set); in decFloatAbs()
1082 decCanonical(result, df); /* copy and check */ in decFloatAbs()
1621 decFloat * decFloatCanonical(decFloat *result, const decFloat *df) { in decFloatCanonical() argument
1622 return decCanonical(result, df); in decFloatCanonical()
1631 enum decClass decFloatClass(const decFloat *df) { in decFloatClass() argument
1633 if (DFISSPECIAL(df)) { in decFloatClass()
1634 if (DFISQNAN(df)) return DEC_CLASS_QNAN; in decFloatClass()
1635 if (DFISSNAN(df)) return DEC_CLASS_SNAN; in decFloatClass()
1637 if (DFISSIGNED(df)) return DEC_CLASS_NEG_INF; in decFloatClass()
1640 if (DFISZERO(df)) { /* quite common */ in decFloatClass()
1641 if (DFISSIGNED(df)) return DEC_CLASS_NEG_ZERO; in decFloatClass()
1646 exp=GETEXPUN(df) /* get unbiased exponent .. */ in decFloatClass()
1647 +decFloatDigits(df)-1; /* .. and make adjusted exponent */ in decFloatClass()
1649 if (DFISSIGNED(df)) return DEC_CLASS_NEG_NORMAL; in decFloatClass()
1653 if (DFISSIGNED(df)) return DEC_CLASS_NEG_SUBNORMAL; in decFloatClass()
1663 const char *decFloatClassString(const decFloat *df) { in decFloatClassString() argument
1664 enum decClass eclass=decFloatClass(df); in decFloatClassString()
1901 uInt decFloatDigits(const decFloat *df) { in decFloatDigits() argument
1903 uInt sourhi=DFWORD(df, 0); /* top word from source decFloat */ in decFloatDigits()
1909 if (DFISINF(df)) return 1; in decFloatDigits()
1912 if (!DFISNAN(df) && DECCOMBMSD[sourhi>>26]) return DECPMAX; in decFloatDigits()
1917 sourlo=DFWORD(df, 1); in decFloatDigits()
1920 sourlo=DFWORD(df, 1); /* sourhi not involved now */ in decFloatDigits()
1932 sourmh=DFWORD(df, 1); in decFloatDigits()
1935 sourmh=DFWORD(df, 1); in decFloatDigits()
1940 sourml=DFWORD(df, 2); in decFloatDigits()
1943 sourml=DFWORD(df, 2); in decFloatDigits()
1948 sourlo=DFWORD(df, 3); in decFloatDigits()
1951 sourlo=DFWORD(df, 3); in decFloatDigits()
2349 decFloat * decFloatInvert(decFloat *result, const decFloat *df, in decFloatInvert() argument
2351 uInt sourhi=DFWORD(df, 0); /* top word of dfs */ in decFloatInvert()
2353 if (!DFISUINT01(df) || !DFISCC01(df)) return decInvalid(result, set); in decFloatInvert()
2357 DFWORD(result, 1)=(~DFWORD(df, 1)) &0x49124491; in decFloatInvert()
2360 DFWORD(result, 1)=(~DFWORD(df, 1)) &0x44912449; in decFloatInvert()
2361 DFWORD(result, 2)=(~DFWORD(df, 2)) &0x12449124; in decFloatInvert()
2362 DFWORD(result, 3)=(~DFWORD(df, 3)) &0x49124491; in decFloatInvert()
2377 uInt decFloatIsCanonical(const decFloat *df) { in decFloatIsCanonical() argument
2378 if (DFISSPECIAL(df)) { in decFloatIsCanonical()
2379 if (DFISINF(df)) { in decFloatIsCanonical()
2380 if (DFWORD(df, 0)&ECONMASK) return 0; /* exponent continuation */ in decFloatIsCanonical()
2381 if (!DFISCCZERO(df)) return 0; /* coefficient continuation */ in decFloatIsCanonical()
2385 if (DFWORD(df, 0)&ECONNANMASK) return 0; /* exponent continuation */ in decFloatIsCanonical()
2386 if (DFISCCZERO(df)) return 1; /* coefficient continuation */ in decFloatIsCanonical()
2391 uInt sourhi=DFWORD(df, 0); in decFloatIsCanonical()
2392 uInt sourlo=DFWORD(df, 1); in decFloatIsCanonical()
2399 uInt sourhi=DFWORD(df, 0); in decFloatIsCanonical()
2400 uInt sourmh=DFWORD(df, 1); in decFloatIsCanonical()
2401 uInt sourml=DFWORD(df, 2); in decFloatIsCanonical()
2402 uInt sourlo=DFWORD(df, 3); in decFloatIsCanonical()
2419 uInt decFloatIsFinite(const decFloat *df) { in decFloatIsFinite() argument
2420 return !DFISSPECIAL(df); in decFloatIsFinite()
2422 uInt decFloatIsInfinite(const decFloat *df) { in decFloatIsInfinite() argument
2423 return DFISINF(df); in decFloatIsInfinite()
2425 uInt decFloatIsInteger(const decFloat *df) { in decFloatIsInteger() argument
2426 return DFISINT(df); in decFloatIsInteger()
2428 uInt decFloatIsNaN(const decFloat *df) { in decFloatIsNaN() argument
2429 return DFISNAN(df); in decFloatIsNaN()
2431 uInt decFloatIsNormal(const decFloat *df) { in decFloatIsNormal() argument
2433 if (DFISSPECIAL(df)) return 0; in decFloatIsNormal()
2434 if (DFISZERO(df)) return 0; in decFloatIsNormal()
2436 exp=GETEXPUN(df) /* get unbiased exponent .. */ in decFloatIsNormal()
2437 +decFloatDigits(df)-1; /* .. and make adjusted exponent */ in decFloatIsNormal()
2440 uInt decFloatIsSignaling(const decFloat *df) { in decFloatIsSignaling() argument
2441 return DFISSNAN(df); in decFloatIsSignaling()
2443 uInt decFloatIsSignalling(const decFloat *df) { in decFloatIsSignalling() argument
2444 return DFISSNAN(df); in decFloatIsSignalling()
2446 uInt decFloatIsSigned(const decFloat *df) { in decFloatIsSigned() argument
2447 return DFISSIGNED(df); in decFloatIsSigned()
2449 uInt decFloatIsSubnormal(const decFloat *df) { in decFloatIsSubnormal() argument
2450 if (DFISSPECIAL(df)) return 0; in decFloatIsSubnormal()
2452 if (decFloatIsNormal(df)) return 0; in decFloatIsSubnormal()
2454 if (DFISZERO(df)) return 0; in decFloatIsSubnormal()
2457 uInt decFloatIsZero(const decFloat *df) { in decFloatIsZero() argument
2458 return DFISZERO(df); in decFloatIsZero()
2476 decFloat * decFloatLogB(decFloat *result, const decFloat *df, in decFloatLogB() argument
2479 if (DFISNAN(df)) return decNaNs(result, df, NULL, set); in decFloatLogB()
2480 if (DFISINF(df)) { in decFloatLogB()
2484 if (DFISZERO(df)) { in decFloatLogB()
2489 ae=GETEXPUN(df) /* get unbiased exponent .. */ in decFloatLogB()
2490 +decFloatDigits(df)-1; /* .. and make adjusted exponent */ in decFloatLogB()
2641 decFloat * decFloatMinus(decFloat *result, const decFloat *df, in decFloatMinus() argument
2643 if (DFISNAN(df)) return decNaNs(result, df, NULL, set); in decFloatMinus()
2644 decCanonical(result, df); /* copy and check */ in decFloatMinus()
2645 if (DFISZERO(df)) DFBYTE(result, 0)&=~0x80; /* turn off sign bit */ in decFloatMinus()
2880 decFloat * decFloatPlus(decFloat *result, const decFloat *df, in decFloatPlus() argument
2882 if (DFISNAN(df)) return decNaNs(result, df, NULL, set); in decFloatPlus()
2883 decCanonical(result, df); /* copy and check */ in decFloatPlus()
2884 if (DFISZERO(df)) DFBYTE(result, 0)&=~0x80; /* turn off sign bit */ in decFloatPlus()
3190 decFloat * decFloatReduce(decFloat *result, const decFloat *df, in decFloatReduce() argument
3194 if (df!=result) *result=*df; /* copy, if needed */ in decFloatReduce()
3195 if (DFISNAN(df)) return decNaNs(result, df, NULL, set); /* sNaN */ in decFloatReduce()
3197 if (DFISINF(df)) return decInfinity(result, df); /* canonical */ in decFloatReduce()
3198 if (DFISZERO(df)) { in decFloatReduce()
3199 uInt sign=DFWORD(df, 0)&DECFLOAT_Sign; in decFloatReduce()
3205 GETCOEFF(df, buf); in decFloatReduce()
3210 num.sign=DFWORD(df, 0)&DECFLOAT_Sign; /* set up number... */ in decFloatReduce()
3211 num.exponent=GETEXPUN(df)+(Int)(buf+DECPMAX-1-ub); /* adjusted exponent */ in decFloatReduce()
3481 uInt decFloatToUInt32(const decFloat *df, decContext *set, in decFloatToUInt32() argument
3483 return decToInt32(df, set, round, 0, 1);} in decFloatToUInt32()
3485 uInt decFloatToUInt32Exact(const decFloat *df, decContext *set, in decFloatToUInt32Exact() argument
3487 return decToInt32(df, set, round, 1, 1);} in decFloatToUInt32Exact()
3489 Int decFloatToInt32(const decFloat *df, decContext *set, in decFloatToInt32() argument
3491 return (Int)decToInt32(df, set, round, 0, 0);} in decFloatToInt32()
3493 Int decFloatToInt32Exact(const decFloat *df, decContext *set, in decFloatToInt32Exact() argument
3495 return (Int)decToInt32(df, set, round, 1, 0);} in decFloatToInt32Exact()
3509 decFloat * decFloatToIntegralValue(decFloat *result, const decFloat *df, in decFloatToIntegralValue() argument
3511 return decToIntegral(result, df, set, round, 0);} in decFloatToIntegralValue()
3513 decFloat * decFloatToIntegralExact(decFloat *result, const decFloat *df, in decFloatToIntegralExact() argument
3515 return decToIntegral(result, df, set, set->round, 1);} in decFloatToIntegralExact()
3574 static decFloat *decInfinity(decFloat *result, const decFloat *df) { in decInfinity() argument
3575 uInt sign=DFWORD(df, 0); /* save source signword */ in decInfinity()
3788 static uInt decToInt32(const decFloat *df, decContext *set, argument
3797 sourhi=DFWORD(df, 0); /* top word */
3805 if (GETEXPUN(df)==0) result=*df; /* already a true integer */
3814 decFloatQuantize(&result, df, &zero, set); /* [this may fail] */
3875 static decFloat * decToIntegral(decFloat *result, const decFloat *df, argument
3885 sourhi=DFWORD(df, 0); /* top word */
3890 if (DFISNAN(df)) return decNaNs(result, df, NULL, set);
3892 return decInfinity(result, df);
3897 exp+=GETECON(df)-DECBIAS; /* .. + continuation and unbias */
3899 if (exp>=0) return decCanonical(result, df); /* already integral */
3905 decFloatQuantize(result, df, &zero, set); /* 'integrate'; cannot fail */