diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2012-03-02 19:33:50 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2012-03-02 19:33:50 +0000 |
commit | 8a7e70572083c8d964bcbf7297a4d2868835f225 (patch) | |
tree | 0cc053e0fe680c6d7426a184dff112e4d3c22299 /src/mul.c | |
parent | bef243d0bdd8914b1f7a364b1dd32f3df882c389 (diff) | |
download | mpc-8a7e70572083c8d964bcbf7297a4d2868835f225.tar.gz |
sqr.c, mul.c: in the naive algorithm, redo computations with exact exponents
in more cases; corrects bug for test
+ - 10 0b1e-1073741824 10 0 100 0b1@-536870912 100 0b1@-536870913 N N
(not yet added to sqr.dat)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1134 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src/mul.c')
-rw-r--r-- | src/mul.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,6 +1,6 @@ /* mpc_mul -- Multiply two complex numbers -Copyright (C) 2002, 2004, 2005, 2008, 2009, 2010, 2011 INRIA +Copyright (C) 2002, 2004, 2005, 2008, 2009, 2010, 2011, 2012 INRIA This file is part of GNU MPC. @@ -201,10 +201,9 @@ mpfr_fmma (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_set_si (z, (mpfr_signbit (z) ? -1 : 1), GMP_RNDN); inex = mpfr_mul_2ui (z, z, mpfr_get_emax (), rnd); } - else if (mpfr_nan_p (z) || (mpfr_zero_p (u) && mpfr_zero_p (v))) { - /* In the first case, u and v are infinities with opposite signs. - In the second case, u and v are zeroes; their sum may be 0 or the - least representable number, with a sign to be determined. + else if (mpfr_inf_p (u) || mpfr_inf_p (v) + || mpfr_zero_p (u) || mpfr_zero_p (v)) { + /* There is at least one over- or underflow. Redo the computations with mpz_t exponents */ mpfr_exp_t ea, eb, ec, ed; mpz_t eu, ev; |