summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-06-11 17:30:44 +0000
committerenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-06-11 17:30:44 +0000
commit5c547deae1c40c41ea27ebda0b39c3e2cdb965ef (patch)
tree8855a9a773967442518d1ecdd9a778a9cf8b9633
parent8ba2bc726642350ab369cd4f16ad040bc7af346e (diff)
downloadmpc-5c547deae1c40c41ea27ebda0b39c3e2cdb965ef.tar.gz
mul_si.c: removed workaround for gmp-4.1.4
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@600 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r--src/mul_si.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/mul_si.c b/src/mul_si.c
index 6a9a499..49238f4 100644
--- a/src/mul_si.c
+++ b/src/mul_si.c
@@ -24,28 +24,10 @@ MA 02111-1307, USA. */
int
mpc_mul_si (mpc_ptr a, mpc_srcptr b, long int c, mpc_rnd_t rnd)
{
- int inex_re, inex_im;
-
- /* We could use mpfr_mul_si with newer versions of mpfr (2.1.0), but
- not with the version contained in gmp-4.1.4. So copy and paste for
- the time being */
- if (c >= 0)
- /* inlining by copy and paste */
- {
- inex_re = mpfr_mul_ui (MPC_RE(a), MPC_RE(b), (unsigned long int) c,
- MPC_RND_RE(rnd));
- inex_im = mpfr_mul_ui (MPC_IM(a), MPC_IM(b), (unsigned long int) c,
- MPC_RND_IM(rnd));
- }
- else
- {
- inex_re = -mpfr_mul_ui (MPC_RE(a), MPC_RE(b), (unsigned long int) (-c),
- INV_RND (MPC_RND_RE(rnd)));
- MPFR_CHANGE_SIGN (MPC_RE (a));
- inex_im = -mpfr_mul_ui (MPC_IM(a), MPC_IM(b), (unsigned long int) (-c),
- INV_RND (MPC_RND_IM(rnd)));
- MPFR_CHANGE_SIGN (MPC_IM (a));
- }
-
- return MPC_INEX(inex_re, inex_im);
+ int inex_re, inex_im;
+
+ inex_re = mpfr_mul_si (MPC_RE(a), MPC_RE(b), c, MPC_RND_RE(rnd));
+ inex_im = mpfr_mul_si (MPC_IM(a), MPC_IM(b), c, MPC_RND_IM(rnd));
+
+ return MPC_INEX(inex_re, inex_im);
}