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

Function decFloatMinMag

extern/decNumber/decBasic.c:2611–2624  ·  view source on GitHub ↗

------------------------------------------------------------------ */ decFloatMinMag -- return minnummag 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

2609/* unequal, otherwise returns minnum */
2610/* ------------------------------------------------------------------ */
2611decFloat * decFloatMinMag(decFloat *result,
2612 const decFloat *dfl, const decFloat *dfr,
2613 decContext *set) {
2614 Int comp;
2615 decFloat absl, absr;
2616 if (DFISNAN(dfl) || DFISNAN(dfr)) return decFloatMin(result, dfl, dfr, set);
2617
2618 decFloatCopyAbs(&absl, dfl);
2619 decFloatCopyAbs(&absr, dfr);
2620 comp=decNumCompare(&absl, &absr, 0);
2621 if (comp<0) return decCanonical(result, dfl);
2622 if (comp>0) return decCanonical(result, dfr);
2623 return decFloatMin(result, dfl, dfr, set);
2624 } // decFloatMinMag
2625
2626/* ------------------------------------------------------------------ */
2627/* decFloatMinus -- negate value, heeding NaNs, etc. */

Callers

nothing calls this directly

Calls 4

decFloatMinFunction · 0.85
decFloatCopyAbsFunction · 0.85
decNumCompareFunction · 0.85
decCanonicalFunction · 0.85

Tested by

no test coverage detected