summaryrefslogtreecommitdiff
path: root/mul_ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'mul_ui.c')
-rw-r--r--mul_ui.c8
1 files changed, 8 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);