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

Function decFloatMaxMag

extern/decNumber/decBasic.c:2552–2565  ·  view source on GitHub ↗

------------------------------------------------------------------ */ decFloatMaxMag -- return maxnummag of two operands */ / result gets the chosen decFloat */ dfl is the first decFloat (lhs) */ dfr is the second decFloat (rhs) */ set is the context

Source from the content-addressed store, hash-verified

2550/* unequal, otherwise returns maxnum */
2551/* ------------------------------------------------------------------ */
2552decFloat * decFloatMaxMag(decFloat *result,
2553 const decFloat *dfl, const decFloat *dfr,
2554 decContext *set) {
2555 Int comp;
2556 decFloat absl, absr;
2557 if (DFISNAN(dfl) || DFISNAN(dfr)) return decFloatMax(result, dfl, dfr, set);
2558
2559 decFloatCopyAbs(&absl, dfl);
2560 decFloatCopyAbs(&absr, dfr);
2561 comp=decNumCompare(&absl, &absr, 0);
2562 if (comp>0) return decCanonical(result, dfl);
2563 if (comp<0) return decCanonical(result, dfr);
2564 return decFloatMax(result, dfl, dfr, set);
2565 } // decFloatMaxMag
2566
2567/* ------------------------------------------------------------------ */
2568/* decFloatMin -- return minnum of two operands */

Callers

nothing calls this directly

Calls 4

decFloatMaxFunction · 0.85
decFloatCopyAbsFunction · 0.85
decNumCompareFunction · 0.85
decCanonicalFunction · 0.85

Tested by

no test coverage detected