Lines Matching refs:workctx
724 mpd_workcontext(mpd_context_t *workctx, const mpd_context_t *ctx) in mpd_workcontext() argument
726 workctx->prec = ctx->prec; in mpd_workcontext()
727 workctx->emax = ctx->emax; in mpd_workcontext()
728 workctx->emin = ctx->emin; in mpd_workcontext()
729 workctx->round = ctx->round; in mpd_workcontext()
730 workctx->traps = 0; in mpd_workcontext()
731 workctx->status = 0; in mpd_workcontext()
732 workctx->newtrap = 0; in mpd_workcontext()
733 workctx->clamp = ctx->clamp; in mpd_workcontext()
734 workctx->allcr = ctx->allcr; in mpd_workcontext()
4223 mpd_context_t workctx; in _mpd_qexp() local
4274 mpd_maxcontext(&workctx); in _mpd_qexp()
4275 workctx.prec = ctx->prec + t + 2; in _mpd_qexp()
4276 workctx.prec = (workctx.prec < 10) ? 10 : workctx.prec; in _mpd_qexp()
4277 workctx.round = MPD_ROUND_HALF_EVEN; in _mpd_qexp()
4291 n = _mpd_get_exp_iterations(result, workctx.prec); in _mpd_qexp()
4302 mpd_qdiv(&tmp, result, &word, &workctx, &workctx.status); in _mpd_qexp()
4303 mpd_qfma(&sum, &sum, &tmp, &one, &workctx, &workctx.status); in _mpd_qexp()
4307 _mpd_qpow_uint(result, &sum, mpd_pow10[t], MPD_POS, &workctx, status); in _mpd_qexp()
4310 _mpd_qpow_uint(result, &sum, mpd_pow10[t], MPD_POS, &workctx, status); in _mpd_qexp()
4315 &workctx, status); in _mpd_qexp()
4316 _mpd_qpow_uint(result, &tmp, mpd_pow10[t], MPD_POS, &workctx, status); in _mpd_qexp()
4322 *status |= (workctx.status&MPD_Errors); in _mpd_qexp()
4331 mpd_context_t workctx; in mpd_qexp() local
4350 workctx = *ctx; in mpd_qexp()
4351 workctx.round = MPD_ROUND_HALF_EVEN; in mpd_qexp()
4370 workctx.clamp = 0; in mpd_qexp()
4373 workctx.prec = prec; in mpd_qexp()
4376 _mpd_qexp(result, a, &workctx, &workstatus); in mpd_qexp()
4379 ulpexp = result->exp + result->digits - workctx.prec; in mpd_qexp()
4399 workctx.prec = ctx->prec; in mpd_qexp()
4400 mpd_qadd(&t1, result, &ulp, &workctx, &workctx.status); in mpd_qexp()
4401 mpd_qsub(&t2, result, &ulp, &workctx, &workctx.status); in mpd_qexp()
4404 workctx.clamp = ctx->clamp; in mpd_qexp()
4405 _mpd_zeropad(result, &workctx, status); in mpd_qexp()
4406 mpd_check_underflow(result, &workctx, status); in mpd_qexp()
4407 mpd_qfinalize(result, &workctx, status); in mpd_qexp()
4418 _mpd_qexp(result, a, &workctx, status); in mpd_qexp()
4419 _mpd_zeropad(result, &workctx, status); in mpd_qexp()
4420 mpd_check_underflow(result, &workctx, status); in mpd_qexp()
4421 mpd_qfinalize(result, &workctx, status); in mpd_qexp()
4851 mpd_context_t workctx; in mpd_qln() local
4907 workctx = *ctx; in mpd_qln()
4908 workctx.round = MPD_ROUND_HALF_EVEN; in mpd_qln()
4925 workctx.clamp = 0; in mpd_qln()
4928 workctx.prec = prec; in mpd_qln()
4929 _mpd_qln(result, a, &workctx, status); in mpd_qln()
4931 result->exp + result->digits-workctx.prec); in mpd_qln()
4933 workctx.prec = ctx->prec; in mpd_qln()
4934 mpd_qadd(&t1, result, &ulp, &workctx, &workctx.status); in mpd_qln()
4935 mpd_qsub(&t2, result, &ulp, &workctx, &workctx.status); in mpd_qln()
4938 workctx.clamp = ctx->clamp; in mpd_qln()
4939 mpd_check_underflow(result, &workctx, status); in mpd_qln()
4940 mpd_qfinalize(result, &workctx, status); in mpd_qln()
4951 _mpd_qln(result, a, &workctx, status); in mpd_qln()
4952 mpd_check_underflow(result, &workctx, status); in mpd_qln()
4953 mpd_qfinalize(result, &workctx, status); in mpd_qln()
4969 mpd_context_t workctx; in _mpd_qlog10() local
4972 mpd_maxcontext(&workctx); in _mpd_qlog10()
4973 workctx.prec = ctx->prec + 3; in _mpd_qlog10()
4976 _mpd_qln(result, a, &workctx, status); in _mpd_qlog10()
4978 mpd_qln10(&ln10, workctx.prec, status); in _mpd_qlog10()
4981 workctx = *ctx; in _mpd_qlog10()
4982 workctx.round = MPD_ROUND_HALF_EVEN; in _mpd_qlog10()
4985 _mpd_qdiv(NO_IDEAL_EXP, result, result, &ln10, &workctx, status); in _mpd_qlog10()
4995 mpd_context_t workctx; in mpd_qlog10() local
4998 workctx = *ctx; in mpd_qlog10()
4999 workctx.round = MPD_ROUND_HALF_EVEN; in mpd_qlog10()
5028 mpd_qfinalize(result, &workctx, status); in mpd_qlog10()
5074 workctx.clamp = 0; in mpd_qlog10()
5077 workctx.prec = prec; in mpd_qlog10()
5078 _mpd_qlog10(SKIP_FINALIZE, result, a, &workctx, status); in mpd_qlog10()
5080 result->exp + result->digits-workctx.prec); in mpd_qlog10()
5082 workctx.prec = ctx->prec; in mpd_qlog10()
5083 mpd_qadd(&t1, result, &ulp, &workctx, &workctx.status); in mpd_qlog10()
5084 mpd_qsub(&t2, result, &ulp, &workctx, &workctx.status); in mpd_qlog10()
5087 workctx.clamp = ctx->clamp; in mpd_qlog10()
5088 mpd_check_underflow(result, &workctx, status); in mpd_qlog10()
5089 mpd_qfinalize(result, &workctx, status); in mpd_qlog10()
5100 _mpd_qlog10(DO_FINALIZE, result, a, &workctx, status); in mpd_qlog10()
5101 mpd_check_underflow(result, &workctx, status); in mpd_qlog10()
5984 mpd_context_t workctx; in mpd_qnext_minus() local
6008 mpd_workcontext(&workctx, ctx); in mpd_qnext_minus()
6009 workctx.round = MPD_ROUND_FLOOR; in mpd_qnext_minus()
6015 mpd_qfinalize(result, &workctx, &workctx.status); in mpd_qnext_minus()
6016 if (workctx.status&(MPD_Inexact|MPD_Errors)) { in mpd_qnext_minus()
6017 *status |= (workctx.status&MPD_Errors); in mpd_qnext_minus()
6021 workctx.status = 0; in mpd_qnext_minus()
6022 mpd_qsub(result, a, &tiny, &workctx, &workctx.status); in mpd_qnext_minus()
6023 *status |= (workctx.status&MPD_Errors); in mpd_qnext_minus()
6031 mpd_context_t workctx; in mpd_qnext_plus() local
6055 mpd_workcontext(&workctx, ctx); in mpd_qnext_plus()
6056 workctx.round = MPD_ROUND_CEILING; in mpd_qnext_plus()
6062 mpd_qfinalize(result, &workctx, &workctx.status); in mpd_qnext_plus()
6063 if (workctx.status & (MPD_Inexact|MPD_Errors)) { in mpd_qnext_plus()
6064 *status |= (workctx.status&MPD_Errors); in mpd_qnext_plus()
6068 workctx.status = 0; in mpd_qnext_plus()
6069 mpd_qadd(result, a, &tiny, &workctx, &workctx.status); in mpd_qnext_plus()
6070 *status |= (workctx.status&MPD_Errors); in mpd_qnext_plus()
6206 mpd_context_t workctx; in _mpd_qpow_int() local
6212 mpd_workcontext(&workctx, ctx); in _mpd_qpow_int()
6213 workctx.prec += (exp->digits + exp->exp + 2); in _mpd_qpow_int()
6214 workctx.round = MPD_ROUND_HALF_EVEN; in _mpd_qpow_int()
6215 workctx.clamp = 0; in _mpd_qpow_int()
6217 workctx.prec += 1; in _mpd_qpow_int()
6218 mpd_qdiv(&tbase, &one, base, &workctx, status); in _mpd_qpow_int()
6231 n = mpd_qabs_uint(exp, &workctx.status); in _mpd_qpow_int()
6232 if (workctx.status&MPD_Invalid_operation) { in _mpd_qpow_int()
6237 _mpd_qpow_mpd(result, &tbase, &texp, resultsign, &workctx, status); in _mpd_qpow_int()
6240 _mpd_qpow_uint(result, &tbase, n, resultsign, &workctx, status); in _mpd_qpow_int()
6495 mpd_context_t workctx; in _mpd_qpow_real() local
6503 mpd_maxcontext(&workctx); in _mpd_qpow_real()
6504 workctx.prec = (base->digits > ctx->prec) ? base->digits : ctx->prec; in _mpd_qpow_real()
6505 workctx.prec += (4 + MPD_EXPDIGITS); in _mpd_qpow_real()
6506 workctx.round = MPD_ROUND_HALF_EVEN; in _mpd_qpow_real()
6507 workctx.allcr = ctx->allcr; in _mpd_qpow_real()
6533 mpd_qln(result, base, &workctx, &workctx.status); in _mpd_qpow_real()
6534 mpd_qmul(result, result, &texp, &workctx, &workctx.status); in _mpd_qpow_real()
6535 mpd_qexp(result, result, &workctx, status); in _mpd_qpow_real()
6538 *status |= (workctx.status&MPD_Errors); in _mpd_qpow_real()
6948 mpd_context_t workctx; in mpd_qrem_near() local
7003 mpd_maxcontext(&workctx); in mpd_qrem_near()
7006 _mpd_qsub(&q, r, b, &workctx, &workctx.status); in mpd_qrem_near()
7010 _mpd_qadd(&q, r, b, &workctx, &workctx.status); in mpd_qrem_near()
7013 if (workctx.status&MPD_Errors) { in mpd_qrem_near()
7014 mpd_seterror(r, workctx.status&MPD_Errors, status); in mpd_qrem_near()
7191 mpd_context_t workctx = *ctx; in mpd_qfloor() local
7192 workctx.round = MPD_ROUND_FLOOR; in mpd_qfloor()
7194 &workctx, status); in mpd_qfloor()
7201 mpd_context_t workctx = *ctx; in mpd_qceil() local
7202 workctx.round = MPD_ROUND_CEILING; in mpd_qceil()
7204 &workctx, status); in mpd_qceil()
7365 mpd_context_t workctx; in _mpd_base_ndivmod() local
7391 mpd_maxcontext(&workctx); in _mpd_base_ndivmod()
7394 workctx.prec = a->digits - b->digits + 1 + 3; in _mpd_base_ndivmod()
7395 if (a->digits > MPD_MAX_PREC || workctx.prec > MPD_MAX_PREC) { in _mpd_base_ndivmod()
7405 _mpd_qreciprocal(rr, &bb, &workctx, &workctx.status); in _mpd_base_ndivmod()
7411 _mpd_qmul(qq, &aa, rr, &workctx, &workctx.status); in _mpd_base_ndivmod()
7415 mpd_qtrunc(qq, qq, &workctx, &workctx.status); in _mpd_base_ndivmod()
7417 workctx.prec = aa.digits + 3; in _mpd_base_ndivmod()
7418 workctx.emax = MPD_MAX_EMAX + 3; in _mpd_base_ndivmod()
7419 workctx.emin = MPD_MIN_EMIN - 3; in _mpd_base_ndivmod()
7423 _mpd_qmul(rr, &bb, qq, &workctx, &workctx.status); in _mpd_base_ndivmod()
7425 _mpd_qsub_exact(rr, &aa, rr, &workctx, &workctx.status); in _mpd_base_ndivmod()
7431 *status |= (workctx.status&MPD_Errors); in _mpd_base_ndivmod()
7442 _mpd_qadd_exact(rr, rr, &bb, &workctx, &workctx.status); in _mpd_base_ndivmod()
7443 _mpd_qadd_exact(qq, qq, &minus_one, &workctx, &workctx.status); in _mpd_base_ndivmod()
7451 _mpd_qsub_exact(rr, rr, &bb, &workctx, &workctx.status); in _mpd_base_ndivmod()
7452 _mpd_qadd_exact(qq, qq, &one, &workctx, &workctx.status); in _mpd_base_ndivmod()
7469 *status |= (workctx.status&MPD_Errors); in _mpd_base_ndivmod()
7671 mpd_context_t workctx; in mpd_qinvroot() local
7696 workctx = *ctx; in mpd_qinvroot()
7697 workctx.prec += 2; in mpd_qinvroot()
7698 workctx.round = MPD_ROUND_HALF_EVEN; in mpd_qinvroot()
7699 _mpd_qinvroot(result, a, &workctx, status); in mpd_qinvroot()