diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2011-02-23 19:41:09 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2011-02-23 19:41:09 +0000 |
commit | e68521916d4a04d2a8008e0c63bce7d48b463e1a (patch) | |
tree | 730d0636a97c37d60f73f82a79c7fb5f3c034a06 /src/sin_cos.c | |
parent | 55981426f41a07c1de243772a32f071f8f66c6c4 (diff) | |
download | mpc-e68521916d4a04d2a8008e0c63bce7d48b463e1a.tar.gz |
sin_cos.c: fixed reuse error introduced with previous revision
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@962 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src/sin_cos.c')
-rw-r--r-- | src/sin_cos.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sin_cos.c b/src/sin_cos.c index b2cede1..9c8ad50 100644 --- a/src/sin_cos.c +++ b/src/sin_cos.c @@ -185,6 +185,7 @@ mpc_sin_cos_real (mpc_ptr rop_sin, mpc_ptr rop_cos, mpc_srcptr op, by definition, for not computed values. */ mpfr_t s, c; int inex_s, inex_c; + int sign_im = mpfr_signbit (MPC_IM (op)); /* sin(x +-0*i) = sin(x) +-0*i*sign(cos(x)) */ /* cos(x +-i*0) = cos(x) -+i*0*sign(sin(x)) */ @@ -206,16 +207,16 @@ mpc_sin_cos_real (mpc_ptr rop_sin, mpc_ptr rop_cos, mpc_srcptr op, mpfr_set (MPC_RE (rop_sin), s, GMP_RNDN); /* exact */ inex_sin_re = inex_s; mpfr_set_zero (MPC_IM (rop_sin), - ( ( mpfr_signbit (MPC_IM(op)) && !mpfr_signbit(c)) - || (!mpfr_signbit (MPC_IM(op)) && mpfr_signbit(c)) ? -1 : 1)); + ( ( sign_im && !mpfr_signbit(c)) + || (!sign_im && mpfr_signbit(c)) ? -1 : 1)); } if (rop_cos != NULL) { mpfr_set (MPC_RE (rop_cos), c, GMP_RNDN); /* exact */ inex_cos_re = inex_c; mpfr_set_zero (MPC_IM (rop_cos), - ( ( mpfr_signbit (MPC_IM(op)) && mpfr_signbit(s)) - || (!mpfr_signbit (MPC_IM(op)) && !mpfr_signbit(s)) ? -1 : 1)); + ( ( sign_im && mpfr_signbit(s)) + || (!sign_im && !mpfr_signbit(s)) ? -1 : 1)); } mpfr_clear (s); |