diff options
author | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2013-12-02 18:18:13 +0000 |
---|---|---|
committer | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2013-12-02 18:18:13 +0000 |
commit | 5a068b078040123013e93664ced89e3a9c68bd8a (patch) | |
tree | 973f052ac6c746c96273b9b6d34d0603765201a5 | |
parent | 99a9b960a8b9a0851072b1c0abc1f156f7accca6 (diff) | |
download | mpc-5a068b078040123013e93664ced89e3a9c68bd8a.tar.gz |
[tests/] Fix ternary value checking.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/branches/benchs_tests@1354 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r-- | tests/tgeneric.tpl | 23 |
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 */ |