------------------------------------------------------------------ */ 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
| 7510 | /* restriction is violated. */ |
| 7511 | /* ------------------------------------------------------------------ */ |
| 7512 | static 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 */ |
no outgoing calls
no test coverage detected