Lines Matching refs:status

65 /* 4. Error handling: the type of the error is ORed into the status   */
70 /* It is the responsibility of the caller to clear the status */
110 /* 3. Setting status in the context must always be the very last */
111 /* action in a routine, as non-0 status may raise a trap and hence */
112 /* the call to set status may not return (if the handler uses long */
114 /* to achieve this we accumulate status and only finally apply it */
189 #define DEC_sNaN 0x40000000 /* local status: sNaN signal */
315 /* No error is possible, and no status can be set. */
371 uInt status = 0; /* error code */
379 { /* status & malloc protection */
415 status = DEC_Conversion_syntax;
431 status = DEC_Conversion_syntax; /* assume the worst */
453 status = 0; /* it's good */
468 status = 0;
481 status = DEC_Conversion_syntax;
497 status = DEC_Conversion_syntax;
513 status = DEC_Conversion_syntax;
568 status |= DEC_Insufficient_storage;
619 decSetCoeff (dn, set, res, d, &residue, &status);
622 decFinalize (dn, set, &residue, &status);
629 if (status != 0)
630 decStatus (dn, status, set);
656 uInt status = 0; /* accumulator */
665 decAddOp (res, &dzero, rhs, set, (uByte) (rhs->bits & DECNEG), &status);
666 if (status != 0)
667 decStatus (res, status, set);
688 uInt status = 0; /* accumulator */
689 decAddOp (res, lhs, rhs, set, 0, &status);
690 if (status != 0)
691 decStatus (res, status, set);
711 uInt status = 0; /* accumulator */
712 decCompareOp (res, lhs, rhs, set, COMPARE, &status);
713 if (status != 0)
714 decStatus (res, status, set);
734 uInt status = 0; /* accumulator */
735 decDivideOp (res, lhs, rhs, set, DIVIDE, &status);
736 if (status != 0)
737 decStatus (res, status, set);
757 uInt status = 0; /* accumulator */
758 decDivideOp (res, lhs, rhs, set, DIVIDEINT, &status);
759 if (status != 0)
760 decStatus (res, status, set);
780 uInt status = 0; /* accumulator */
781 decCompareOp (res, lhs, rhs, set, COMPMAX, &status);
782 if (status != 0)
783 decStatus (res, status, set);
803 uInt status = 0; /* accumulator */
804 decCompareOp (res, lhs, rhs, set, COMPMIN, &status);
805 if (status != 0)
806 decStatus (res, status, set);
827 uInt status = 0; /* accumulator */
836 decAddOp (res, &dzero, rhs, set, DECNEG, &status);
837 if (status != 0)
838 decStatus (res, status, set);
861 uInt status = 0; /* accumulator */
870 decAddOp (res, &dzero, rhs, set, 0, &status);
871 if (status != 0)
872 decStatus (res, status, set);
892 uInt status = 0; /* accumulator */
893 decMultiplyOp (res, lhs, rhs, set, &status);
894 if (status != 0)
895 decStatus (res, status, set);
914 uInt status = 0; /* as usual */
928 /* reduce operand and set lostDigits status, as needed */
931 allocrhs = decRoundOperand (rhs, set, &status);
943 decNaNs (res, rhs, NULL, &status);
948 decCopyFit (res, rhs, set, &residue, &status); /* copy & round */
949 decFinish (res, set, &residue, &status); /* cleanup/set flags */
956 if (status != 0)
957 decStatus (res, status, set); /* then report status */
992 uInt status = 0; /* accumulator */
1012 /* reduce operands and set lostDigits status, as needed */
1015 alloclhs = decRoundOperand (lhs, set, &status);
1024 allocrhs = decRoundOperand (rhs, set, &status);
1036 status |= DEC_Invalid_operation; /* bad */
1042 decNaNs (res, lhs, rhs, &status);
1054 status |= DEC_Invalid_operation;
1089 status |= DEC_Invalid_operation;
1103 status |= DEC_Insufficient_storage;
1119 status |= DEC_Invalid_operation;
1136 decDivideOp (dac, &dnOne, lhs, &workset, DIVIDE, &status);
1148 status |= DEC_Insufficient_storage;
1169 if (status & (DEC_Overflow | DEC_Underflow))
1171 if (status & DEC_Overflow || ISZERO (dac))
1180 decMultiplyOp (dac, dac, lhs, &workset, &status); /* dac=dac*x */
1186 decMultiplyOp (dac, dac, dac, &workset, &status); /* dac=dac*dac [square] */
1190 if (status & (DEC_Overflow | DEC_Subnormal))
1197 if (status & DEC_Overflow)
1198 status ^= DEC_Overflow | DEC_Underflow | DEC_Subnormal;
1201 status &= ~(DEC_Underflow | DEC_Subnormal); /* [one or both] */
1202 status |= DEC_Overflow;
1209 decFinalize (dac, set, &residue, &status);
1219 decDivideOp (dac, &dnOne, dac, &workset, DIVIDE, &status);
1224 decCopyFit (res, dac, set, &residue, &status);
1225 decFinish (res, set, &residue, &status); /* final cleanup */
1239 if (status != 0)
1240 decStatus (res, status, set);
1266 uInt status = 0; /* accumulator */
1267 decQuantizeOp (res, lhs, rhs, set, 1, &status);
1268 if (status != 0)
1269 decStatus (res, status, set);
1295 uInt status = 0; /* accumulator */
1296 decQuantizeOp (res, lhs, rhs, set, 0, &status);
1297 if (status != 0)
1298 decStatus (res, status, set);
1318 uInt status = 0; /* accumulator */
1319 decDivideOp (res, lhs, rhs, set, REMAINDER, &status);
1320 if (status != 0)
1321 decStatus (res, status, set);
1341 uInt status = 0; /* accumulator */
1342 decDivideOp (res, lhs, rhs, set, REMNEAR, &status);
1343 if (status != 0)
1344 decStatus (res, status, set);
1461 uInt status = 0, ignore = 0; /* status accumulators */
1494 /* reduce operand and set lostDigits status, as needed */
1497 allocrhs = decRoundOperand (rhs, set, &status);
1514 status |= DEC_Invalid_operation;
1519 decNaNs (res, rhs, NULL, &status); /* a NaN */
1539 status |= DEC_Invalid_operation;
1556 status |= DEC_Insufficient_storage;
1569 status |= DEC_Insufficient_storage;
1587 /* [Until further notice, no error is possible and status bits */
1707 /* estimation are irrelevant, so status was not accumulated] */
1713 decFinalize (a, set, &residue, &status);
1725 status |= DEC_Inexact | DEC_Rounded;
1729 uInt mstatus = 0; /* local status */
1733 status |= DEC_Inexact | DEC_Rounded;
1740 status |= DEC_Inexact | DEC_Rounded;
1750 status |= DEC_Rounded;
1778 if (status != 0)
1779 decStatus (res, status, set); /* then report status */
1799 uInt status = 0; /* accumulator */
1801 decAddOp (res, lhs, rhs, set, DECNEG, &status);
1802 if (status != 0)
1803 decStatus (res, status, set);
1821 /* The context is used for rounding mode and status after sNaN, but */
1838 uInt status = 0;
1842 decNaNs (res, rhs, NULL, &status); /* a NaN */
1843 if (status != 0)
1844 decStatus (res, status, set);
2206 /* status accumulates status for the caller */
2231 const decNumber * rhs, decContext * set, uByte negate, uInt * status)
2260 /* reduce operands and set lostDigits status, as needed */
2263 alloclhs = decRoundOperand (lhs, set, status);
2271 allocrhs = decRoundOperand (rhs, set, status);
2289 decNaNs (res, lhs, rhs, status);
2297 *status |= DEC_Invalid_operation;
2318 decCopyFit (res, rhs, set, &residue, status); /* copy (as needed) */
2346 *status |= DEC_Rounded; /* [but exact] */
2356 decFinish (res, set, &residue, status); /* clean and finalize */
2366 decCopyFit (res, lhs, set, &residue, status); /* copy (as needed) */
2379 *status |= DEC_Rounded; /* [but exact] */
2388 decFinish (res, set, &residue, status); /* clean and finalize */
2476 decCopyFit (res, rhs, set, &residue, status);
2486 decFinish (res, set, &residue, status); /* done */
2521 *status |= DEC_Insufficient_storage;
2563 decSetCoeff (res, set, acc, res->digits, &residue, status);
2590 decSetCoeff (res, set, acc, res->digits, &residue, status);
2595 decApplyRound (res, set, residue, status);
2606 decFinish (res, set, &residue, status);
2616 && (*status & DEC_Inexact) == 0)
2651 /* status is the usual accumulator */
2709 decContext * set, Flag op, uInt * status)
2761 /* reduce operands and set lostDigits status, as needed */
2764 alloclhs = decRoundOperand (lhs, set, status);
2771 allocrhs = decRoundOperand (rhs, set, status);
2788 decNaNs (res, lhs, rhs, status);
2797 *status |= DEC_Invalid_operation;
2811 decCopyFit (res, lhs, set, &residue, status);
2822 *status |= DEC_Clamped;
2825 decFinish (res, set, &residue, status);
2836 *status |= DEC_Division_undefined; /* 0/0 will become NaN */
2842 *status |= DEC_Invalid_operation;
2845 *status |= DEC_Division_by_zero; /* x/0 */
2868 decFinalize (res, set, &residue, status); /* check exponent */
2918 decCopyFit (res, lhs, set, &residue, status);
2919 decFinish (res, set, &residue, status);
2936 *status |= DEC_Insufficient_storage;
2965 *status |= DEC_Insufficient_storage;
3233 *status |= DEC_Division_impossible;
3312 *status |= DEC_Insufficient_storage;
3357 *status |= DEC_Division_impossible;
3386 decSetCoeff (res, set, accnext, accdigits, &residue, status);
3388 decFinish (res, set, &residue, status); /* final cleanup */
3418 /* status is the usual accumulator */
3431 const decNumber * rhs, decContext * set, uInt * status)
3458 /* reduce operands and set lostDigits status, as needed */
3461 alloclhs = decRoundOperand (lhs, set, status);
3468 allocrhs = decRoundOperand (rhs, set, status);
3486 decNaNs (res, lhs, rhs, status);
3493 *status |= DEC_Invalid_operation;
3517 *status |= DEC_Insufficient_storage;
3574 decSetCoeff (res, set, acc, res->digits, &residue, status);
3576 decFinish (res, set, &residue, status); /* final cleanup */
3603 /* status is the status accumulator (this can be called without */
3613 const decNumber * rhs, decContext * set, Flag quant, uInt * status)
3634 /* reduce operands and set lostDigits status, as needed */
3637 alloclhs = decRoundOperand (lhs, set, status);
3644 allocrhs = decRoundOperand (rhs, set, status);
3659 decNaNs (res, lhs, rhs, status);
3662 *status |= DEC_Invalid_operation;
3691 *status |= DEC_Invalid_operation;
3711 *status |= DEC_Invalid_operation;
3723 decCopyFit (res, lhs, &workset, &residue, status); /* fit to result */
3724 decApplyRound (res, &workset, residue, status); /* .. and round */
3757 *status |= DEC_Invalid_operation;
3762 decFinalize (res, set, &residue, status); /* set subnormal flags */
3763 *status &= ~DEC_Underflow; /* suppress Underflow [754r] */
3786 /* status is the usual accumulator */
3796 decContext * set, Flag op, uInt * status)
3814 /* reduce operands and set lostDigits status, as needed */
3817 alloclhs = decRoundOperand (lhs, set, status);
3827 allocrhs = decRoundOperand (rhs, set, status);
3863 decNaNs (res, lhs, rhs, status);
3872 *status |= DEC_Insufficient_storage; /* rare */
3935 decCopyFit (res, choice, set, &residue, status);
3936 decFinish (res, set, &residue, status);
4561 /* status is the status accumulator */
4565 /* lostDigits and other status may be set by this. */
4575 decRoundOperand (const decNumber * dn, decContext * set, uInt * status)
4578 uInt newstatus = 0; /* status from round */
4587 *status |= DEC_Insufficient_storage;
4596 *status |= newstatus;
4608 /* status contains the current status to be updated */
4615 Int * residue, uInt * status)
4619 decSetCoeff (dest, set, src->lsu, src->digits, residue, status);
4635 /* status is the status accumulator, as usual */
4653 /* DEC_Rounded status is set if any digits are discarded. */
4654 /* DEC_Inexact status is set if any non-zero digits are discarded, or */
4663 Int len, Int * residue, uInt * status)
4691 *status |= (DEC_Inexact | DEC_Rounded); /* record inexactitude */
4696 *status |= DEC_Rounded; /* accumulate Rounded status */
4714 *status |= DEC_Inexact; /* record inexactitude */
4837 *status |= DEC_Inexact; /* record inexactitude */
4855 /* status is the status accumulator, as usual */
4858 /* coefficient constant. The exponent and status are unchanged */
4872 decApplyRound (decNumber * dn, decContext * set, Int residue, uInt * status)
4963 *status |= DEC_Invalid_context;
4998 decSetOverflow (dn, set, status);
5044 *status |=
5069 /* status is the accumulator */
5080 decFinish (decNumber * dn, decContext * set, Int * residue, uInt * status)
5102 decFinalize (dn, set, residue, status);
5112 /* status is the status accumulator */
5121 decFinalize (decNumber * dn, decContext * set, Int * residue, uInt * status)
5135 decSetSubnormal (dn, set, residue, status);
5141 decApplyRound (dn, set, *residue, status);
5150 decSetOverflow (dn, set, status);
5166 *status |= DEC_Clamped; /* and record the dirty deed */
5175 /* status contains the current status to be updated */
5182 decSetOverflow (decNumber * dn, decContext * set, uInt * status)
5195 *status |= DEC_Clamped;
5245 *status |= DEC_Overflow | DEC_Inexact | DEC_Rounded;
5255 /* status contains the current status to be updated */
5267 Int * residue, uInt * status)
5278 *status |= DEC_Underflow | DEC_Subnormal | DEC_Inexact | DEC_Rounded;
5295 *status |= DEC_Invalid_operation;
5301 *status |= DEC_Clamped;
5306 *status |= DEC_Subnormal; /* we have a non-zero subnormal */
5316 *status |= DEC_Invalid_operation;
5320 if (*status & DEC_Inexact)
5321 *status |= DEC_Underflow;
5331 decSetCoeff (dn, &workset, dn->lsu, dn->digits, residue, status);
5332 decApplyRound (dn, &workset, *residue, status);
5336 if (*status & DEC_Inexact)
5337 *status |= DEC_Underflow;
5484 /* status contains the current status */
5492 decNaNs (decNumber * res, const decNumber * lhs, const decNumber * rhs, uInt * status)
5495 /* and status updated if need be */
5497 *status |= DEC_Invalid_operation | DEC_sNaN;
5502 *status |= DEC_Invalid_operation | DEC_sNaN;
5517 /* decStatus -- apply non-zero status */
5520 /* status contains the current status (not yet in context) */
5523 /* If the status is an error status, the number is set to a NaN, */
5527 /* The context status is then updated with the new status. Note that */
5532 decStatus (decNumber * dn, uInt status, decContext * set)
5534 if (status & DEC_NaNs)
5535 { /* error status -> NaN */
5537 if (status & DEC_sNaN)
5538 status &= ~DEC_sNaN;
5545 decContextSetStatus (set, status);