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

Function decNumberMax

extern/decNumber/decNumber.c:1532–1541  ·  view source on GitHub ↗

------------------------------------------------------------------ */ decNumberMax -- compare two Numbers and return the maximum */ / This computes C = A ? B, returning the maximum by 754 rules */ / res is C, the result. C may be A and/or B (e.g., X=X?X) */ lhs is A */ rhs is B

Source from the content-addressed store, hash-verified

1530/* C must have space for set->digits digits. */
1531/* ------------------------------------------------------------------ */
1532decNumber * decNumberMax(decNumber *res, const decNumber *lhs,
1533 const decNumber *rhs, decContext *set) {
1534 uInt status=0; // accumulator
1535 decCompareOp(res, lhs, rhs, set, COMPMAX, &status);
1536 if (status!=0) decStatus(res, status, set);
1537 #if DECCHECK
1538 decCheckInexact(res, set);
1539 #endif
1540 return res;
1541 } // decNumberMax
1542
1543/* ------------------------------------------------------------------ */
1544/* decNumberMaxMag -- compare and return the maximum by magnitude */

Callers

nothing calls this directly

Calls 3

decCompareOpFunction · 0.85
decStatusFunction · 0.85
decCheckInexactFunction · 0.85

Tested by

no test coverage detected