summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/tgeneric.tpl23
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/tgeneric.tpl b/tests/tgeneric.tpl
index ae503fb..3d41934 100644
--- a/tests/tgeneric.tpl
+++ b/tests/tgeneric.tpl
@@ -409,8 +409,19 @@ double_rounding (mpc_fun_param_t *params)
params->P[rnd_index].mpc_rnd);
params->P[out + offset].mpc_data.known_sign_real = -1;
params->P[out + offset].mpc_data.known_sign_imag = -1;
- params->P[offset].mpc_inex_data.real = MPC_INEX_RE (inex);
- params->P[offset].mpc_inex_data.imag = MPC_INEX_IM (inex);
+
+ /* no double rounding means that the ternary value may comes from
+ the high-precision calculation or from the rounding */
+ if (MPC_INEX_RE (inex) == 0)
+ params->P[offset].mpc_inex_data.real =
+ MPC_INEX_RE (params->P[0].mpc_inex);
+ else
+ params->P[offset].mpc_inex_data.real = MPC_INEX_RE (inex);
+ if (MPC_INEX_IM (inex) == 0)
+ params->P[offset].mpc_inex_data.imag =
+ MPC_INEX_IM (params->P[0].mpc_inex);
+ else
+ params->P[offset].mpc_inex_data.imag = MPC_INEX_IM (inex);
}
else
/* double rounding occurs */
@@ -435,7 +446,13 @@ double_rounding (mpc_fun_param_t *params)
params->P[out].mpfr,
params->P[rnd_index].mpfr_rnd);
params->P[out + offset].mpfr_data.known_sign = -1;
- params->P[offset].mpfr_inex = inex;
+
+ /* no double rounding means that the ternary value may comes from
+ the high-precision calculation or from the rounding */
+ if (inex == 0)
+ params->P[offset].mpfr_inex = params->P[0].mpfr_inex;
+ else
+ params->P[offset].mpfr_inex = inex;
}
else
/* double rounding occurs */