MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / decNumberPlus

Function decNumberPlus

extern/decNumber/decNumber.c:1870–1886  ·  view source on GitHub ↗

------------------------------------------------------------------ */ 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

Source from the content-addressed store, hash-verified

1868/* check operands and apply rounding and overflow/underflow testing. */
1869/* ------------------------------------------------------------------ */
1870decNumber * 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 */

Callers 4

decNumberLogBFunction · 0.85
decimal32FromNumberFunction · 0.85
decimal128FromNumberFunction · 0.85
decimal64FromNumberFunction · 0.85

Calls 3

decCheckOperandsFunction · 0.85
decStatusFunction · 0.85
decCheckInexactFunction · 0.85

Tested by

no test coverage detected