summaryrefslogtreecommitdiff
path: root/set.c
diff options
context:
space:
mode:
Diffstat (limited to 'set.c')
-rw-r--r--set.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/set.c b/set.c
index cf10e1cdd..2b1174c9d 100644
--- a/set.c
+++ b/set.c
@@ -37,6 +37,8 @@ mpfr_set4(a, b, rnd_mode, signb)
{
int carry, an, preca = PREC(a), sh; mp_limb_t *ap = MANT(a);
+ if (FLAG_NAN(b)) { SET_NAN(a); return; }
+
carry = mpfr_round_raw(ap, MANT(b), PREC(b), (signb<0), preca, rnd_mode);
EXP(a) = EXP(b);
if (carry) {