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

Function decCheckInexact

extern/decNumber/decNumber.c:8055–8071  ·  view source on GitHub ↗

------------------------------------------------------------------ */ decCheckInexact -- check a normal finite inexact result has digits */ dn is the number to check */ set is the context (for status and precision) */ sets Invalid operation, etc., if some digits are missing */ [this check is not made for DECSUBSET compilation or whe

Source from the content-addressed store, hash-verified

8053/* subnormal is not set] */
8054/* ------------------------------------------------------------------ */
8055static void decCheckInexact(const decNumber *dn, decContext *set) {
8056 #if !DECSUBSET && DECEXTFLAG
8057 if ((set->status & (DEC_Inexact|DEC_Subnormal))==DEC_Inexact
8058 && (set->digits!=dn->digits) && !(dn->bits & DECSPECIAL)) {
8059 #if DECTRACE || DECVERB
8060 printf("Insufficient digits [%ld] on normal Inexact result.\n",
8061 (LI)dn->digits);
8062 decNumberShow(dn);
8063 #endif
8064 decContextSetStatus(set, DEC_Invalid_operation);
8065 }
8066 #else
8067 // next is a noop for quiet compiler
8068 if (dn!=NULL && dn->digits==0) set->status|=DEC_Invalid_operation;
8069 #endif
8070 return;
8071 } // decCheckInexact
8072#endif
8073
8074#if DECALLOC

Callers 15

decNumberAbsFunction · 0.85
decNumberAddFunction · 0.85
decNumberDivideFunction · 0.85
decNumberExpFunction · 0.85
decNumberFMAFunction · 0.85
decNumberLnFunction · 0.85
decNumberLog10Function · 0.85
decNumberMaxFunction · 0.85
decNumberMaxMagFunction · 0.85
decNumberMinFunction · 0.85
decNumberMinMagFunction · 0.85
decNumberMinusFunction · 0.85

Calls 2

decNumberShowFunction · 0.85
decContextSetStatusFunction · 0.85

Tested by

no test coverage detected