------------------------------------------------------------------ */ decNumberPlus -- prefix plus operator */ / This computes C = 0 + A */ / res is C, the result. C may be A */ rhs is A */ set is the context
| 1868 | /* check operands and apply rounding and overflow/underflow testing. */ |
| 1869 | /* ------------------------------------------------------------------ */ |
| 1870 | decNumber * decNumberPlus(decNumber *res, const decNumber *rhs, |
| 1871 | decContext *set) { |
| 1872 | decNumber dzero; |
| 1873 | uInt status=0; // accumulator |
| 1874 | #if DECCHECK |
| 1875 | if (decCheckOperands(res, DECUNUSED, rhs, set)) return res; |
| 1876 | #endif |
| 1877 | |
| 1878 | decNumberZero(&dzero); // make 0 |
| 1879 | dzero.exponent=rhs->exponent; // [no coefficient expansion] |
| 1880 | decAddOp(res, &dzero, rhs, set, 0, &status); |
| 1881 | if (status!=0) decStatus(res, status, set); |
| 1882 | #if DECCHECK |
| 1883 | decCheckInexact(res, set); |
| 1884 | #endif |
| 1885 | return res; |
| 1886 | } // decNumberPlus |
| 1887 | |
| 1888 | /* ------------------------------------------------------------------ */ |
| 1889 | /* decNumberMultiply -- multiply two Numbers */ |
no test coverage detected