summaryrefslogtreecommitdiff
path: root/src/mul_fr.c
diff options
context:
space:
mode:
authorenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-09-07 14:27:42 +0000
committerenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-09-07 14:27:42 +0000
commita79ee8d2a75e1831940cdf8d509a7b032960fe4c (patch)
tree1d4ba134bdd2eed53d7b025b7657030dd1381400 /src/mul_fr.c
parent12dfd6d271e059e2d36686091086a5558119e65d (diff)
downloadmpc-a79ee8d2a75e1831940cdf8d509a7b032960fe4c.tar.gz
reverted to previous revision as far as signs of zeroes are concerned;
see C99 G.5.1.2 and G.5.1.3 git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@669 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src/mul_fr.c')
-rw-r--r--src/mul_fr.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/mul_fr.c b/src/mul_fr.c
index 593ceda..88ddbb7 100644
--- a/src/mul_fr.c
+++ b/src/mul_fr.c
@@ -20,26 +20,25 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
#include "mpc-impl.h"
-#include <stdio.h>
int
mpc_mul_fr (mpc_ptr a, mpc_srcptr b, mpfr_srcptr c, mpc_rnd_t rnd)
{
- int inex_re, inex_im;
- mpfr_t real;
+ int inex_re, inex_im;
+ mpfr_t real;
- if (c == MPC_RE (a))
- /* We have to use a temporary variable. */
- mpfr_init2 (real, MPFR_PREC (MPC_RE (a)));
- else
- real [0] = MPC_RE (a) [0];
+ if (c == MPC_RE (a))
+ /* We have to use temporary variable. */
+ mpfr_init2 (real, MPFR_PREC (MPC_RE (a)));
+ else
+ real [0] = MPC_RE (a) [0];
- inex_re = mpfr_mul (real, MPC_RE(b), c, MPC_RND_RE(rnd));
- inex_im = mpfr_mul (MPC_IM(a), MPC_IM(b), c, MPC_RND_IM(rnd));
- mpfr_set (MPC_RE (a), real, GMP_RNDN); /* exact */
+ inex_re = mpfr_mul (real, MPC_RE(b), c, MPC_RND_RE(rnd));
+ inex_im = mpfr_mul (MPC_IM(a), MPC_IM(b), c, MPC_RND_IM(rnd));
+ mpfr_set (MPC_RE (a), real, GMP_RNDN); /* exact */
- if (c == MPC_RE (a))
- mpfr_clear (real);
+ if (c == MPC_RE (a))
+ mpfr_clear (real);
- return MPC_INEX(inex_re, inex_im);
+ return MPC_INEX(inex_re, inex_im);
}