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

Function decCheckMath

extern/decNumber/decNumber.c:7512–7523  ·  view source on GitHub ↗

------------------------------------------------------------------ */ decCheckMath - check entry conditions for a math function */ / This checks the context and the operand */ / rhs is the operand to check */ set is the context to check */ status is unchanged if both are good

Source from the content-addressed store, hash-verified

7510/* restriction is violated. */
7511/* ------------------------------------------------------------------ */
7512static uInt decCheckMath(const decNumber *rhs, decContext *set,
7513 uInt *status) {
7514 uInt save=*status; // record
7515 if (set->digits>DEC_MAX_MATH
7516 || set->emax>DEC_MAX_MATH
7517 || -set->emin>DEC_MAX_MATH) *status|=DEC_Invalid_context;
7518 else if ((rhs->digits>DEC_MAX_MATH
7519 || rhs->exponent+rhs->digits>DEC_MAX_MATH+1
7520 || rhs->exponent+rhs->digits<2*(1-DEC_MAX_MATH))
7521 && !ISZERO(rhs)) *status|=DEC_Invalid_operation;
7522 return (*status!=save);
7523 } // decCheckMath
7524
7525/* ------------------------------------------------------------------ */
7526/* decGetInt -- get integer from a number */

Callers 5

decNumberExpFunction · 0.85
decNumberFMAFunction · 0.85
decNumberLnFunction · 0.85
decNumberLog10Function · 0.85
decNumber.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected