------------------------------------------------------------------ */ decNumberMinus -- prefix minus operator */ / This computes C = 0 - A */ / res is C, the result. C may be A */ rhs is A */ set is the context
| 1624 | /* Simply use AddOp for the subtract, which will do the necessary. */ |
| 1625 | /* ------------------------------------------------------------------ */ |
| 1626 | decNumber * decNumberMinus(decNumber *res, const decNumber *rhs, |
| 1627 | decContext *set) { |
| 1628 | decNumber dzero; |
| 1629 | uInt status=0; // accumulator |
| 1630 | |
| 1631 | #if DECCHECK |
| 1632 | if (decCheckOperands(res, DECUNUSED, rhs, set)) return res; |
| 1633 | #endif |
| 1634 | |
| 1635 | decNumberZero(&dzero); // make 0 |
| 1636 | dzero.exponent=rhs->exponent; // [no coefficient expansion] |
| 1637 | decAddOp(res, &dzero, rhs, set, DECNEG, &status); |
| 1638 | if (status!=0) decStatus(res, status, set); |
| 1639 | #if DECCHECK |
| 1640 | decCheckInexact(res, set); |
| 1641 | #endif |
| 1642 | return res; |
| 1643 | } // decNumberMinus |
| 1644 | |
| 1645 | /* ------------------------------------------------------------------ */ |
| 1646 | /* decNumberNextMinus -- next towards -Infinity */ |
nothing calls this directly
no test coverage detected