summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mul_ui.c8
-rw-r--r--set.c1
-rw-r--r--set_f.c2
3 files changed, 11 insertions, 0 deletions
diff --git a/mul_ui.c b/mul_ui.c
index 44a1dc1d3..3f1c3ecd7 100644
--- a/mul_ui.c
+++ b/mul_ui.c
@@ -40,8 +40,16 @@ mpfr_mul_ui(y, x, u, rnd_mode)
unsigned long xsize, ysize, cnt, dif, ex, sh;
TMP_DECL(marker);
+ if (MPFR_IS_NAN(x))
+ {
+ MPFR_CLEAR_FLAGS(y);
+ MPFR_SET_NAN(y);
+ return;
+ }
+
if (MPFR_IS_INF(x))
{
+ MPFR_CLEAR_FLAGS(y);
if (u)
{
MPFR_SET_INF(y);
diff --git a/set.c b/set.c
index 4556a672b..c82887929 100644
--- a/set.c
+++ b/set.c
@@ -46,6 +46,7 @@ mpfr_set4(a, b, rnd_mode, signb)
if (MPFR_SIGN(a) * signb < 0) MPFR_CHANGE_SIGN(a);
return;
}
+ MPFR_CLEAR_FLAGS(a);
carry = mpfr_round_raw(ap, MPFR_MANT(b), MPFR_PREC(b), (signb<0), preca, rnd_mode);
MPFR_EXP(a) = MPFR_EXP(b);
diff --git a/set_f.c b/set_f.c
index 11ea6a5ec..6b82b0b7c 100644
--- a/set_f.c
+++ b/set_f.c
@@ -50,6 +50,8 @@ mpfr_set_f(y, x, rnd_mode)
return;
}
+ MPFR_CLEAR_FLAGS(y);
+
TMP_MARK(marker);
sx = ABS(SIZ(x)); sy = MPFR_ABSSIZE(y);
my = MPFR_MANT(y); mx = MPFR_MANT(x);