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

Function decNaNs

extern/decNumber/decBasic.c:3595–3609  ·  view source on GitHub ↗

------------------------------------------------------------------ */ decNaNs -- handle NaN argument(s) */ / result gets the result of handling dfl and dfr, one or both of */ which is a NaN */ dfl is the first decFloat (lhs) */ dfr is the second decFloat (rhs) -- may be NULL for a sing

Source from the content-addressed store, hash-verified

3593/* to a qNaN and Invalid operation is set. */
3594/* ------------------------------------------------------------------ */
3595static decFloat *decNaNs(decFloat *result,
3596 const decFloat *dfl, const decFloat *dfr,
3597 decContext *set) {
3598 // handle sNaNs first
3599 if (dfr!=NULL && DFISSNAN(dfr) && !DFISSNAN(dfl)) dfl=dfr; // use RHS
3600 if (DFISSNAN(dfl)) {
3601 decCanonical(result, dfl); // propagate canonical sNaN
3602 DFWORD(result, 0)&=~(DECFLOAT_qNaN ^ DECFLOAT_sNaN); // quiet
3603 set->status|=DEC_Invalid_operation;
3604 return result;
3605 }
3606 // one or both is a quiet NaN
3607 if (!DFISNAN(dfl)) dfl=dfr; // RHS must be NaN, use it
3608 return decCanonical(result, dfl); // propagate canonical qNaN
3609 } // decNaNs
3610
3611/* ------------------------------------------------------------------ */
3612/* decNumCompare -- numeric comparison of two decFloats */

Callers 15

decDivideFunction · 0.70
decFloatAbsFunction · 0.70
decFloatAddFunction · 0.70
decFloatCompareFunction · 0.70
decFloatCompareSignalFunction · 0.70
decFloatFMAFunction · 0.70
decFloatLogBFunction · 0.70
decFloatMaxFunction · 0.70
decFloatMinFunction · 0.70
decFloatMinusFunction · 0.70
decFloatMultiplyFunction · 0.70
decFloatNextTowardFunction · 0.70

Calls 1

decCanonicalFunction · 0.85

Tested by

no test coverage detected