summaryrefslogtreecommitdiff
path: root/div_ui.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-06-29 11:56:51 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-06-29 11:56:51 +0000
commita11d6ad162593d565951e044408798279e61204b (patch)
tree07308f828c0d97c9a7956c84b0c7655adf5c5c9f /div_ui.c
parent155d1ab1d082b965a7fe8c754eaa8a6205827b30 (diff)
downloadmpfr-a11d6ad162593d565951e044408798279e61204b.tar.gz
fixed bug when dividend is 0
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1098 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'div_ui.c')
-rw-r--r--div_ui.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/div_ui.c b/div_ui.c
index bf5e94c05..7589a0987 100644
--- a/div_ui.c
+++ b/div_ui.c
@@ -67,6 +67,12 @@ mpfr_div_ui(y, x, u, rnd_mode)
}
MPFR_CLEAR_INF(y);
+
+ if (MPFR_IS_ZERO(x))
+ {
+ MPFR_SET_ZERO(y);
+ return 0;
+ }
TMP_MARK(marker);
xn = (MPFR_PREC(x)-1)/BITS_PER_MP_LIMB + 1;