summaryrefslogtreecommitdiff
path: root/mpz/cdiv_r_ui.c
diff options
context:
space:
mode:
authortege <tege@gmplib.org>1996-08-27 06:55:40 +0200
committertege <tege@gmplib.org>1996-08-27 06:55:40 +0200
commit1bcc22a2f37efcfd8bb1d25ae0d028acd61f3ce2 (patch)
treecb59de1cdbee985210172f7d3484bbc4dd6e028a /mpz/cdiv_r_ui.c
parenta4f5438c0e49f1a2d151f34a42c99f9e93400e90 (diff)
downloadgmp-1bcc22a2f37efcfd8bb1d25ae0d028acd61f3ce2.tar.gz
Special case for division by 0.
Diffstat (limited to 'mpz/cdiv_r_ui.c')
-rw-r--r--mpz/cdiv_r_ui.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mpz/cdiv_r_ui.c b/mpz/cdiv_r_ui.c
index 757a3f5f7..c28c0a1f6 100644
--- a/mpz/cdiv_r_ui.c
+++ b/mpz/cdiv_r_ui.c
@@ -39,6 +39,9 @@ mpz_cdiv_r_ui (rem, dividend, divisor)
mp_size_t size;
mp_limb_t remainder_limb;
+ if (divisor == 0)
+ DIVIDE_BY_ZERO;
+
dividend_size = dividend->_mp_size;
size = ABS (dividend_size);