------------------------------------------------------------------ */ 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
| 8053 | /* subnormal is not set] */ |
| 8054 | /* ------------------------------------------------------------------ */ |
| 8055 | static 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 |
no test coverage detected