summaryrefslogtreecommitdiff
path: root/div_ui.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-04-19 12:26:06 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-04-19 12:26:06 +0000
commit01a47f270cbdb4460adcee4d119bca071917e441 (patch)
tree40f9bf4f3a15ff0c4f1941981d30486beb0eb16a /div_ui.c
parent73a7c65e1ebdfa0010e59ede641b50aa125483d7 (diff)
downloadmpfr-01a47f270cbdb4460adcee4d119bca071917e441.tar.gz
Added some assertions (any unsigned long must be representable
in a mp_limb_t). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1900 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'div_ui.c')
-rw-r--r--div_ui.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/div_ui.c b/div_ui.c
index 0979ff75d..edb54803c 100644
--- a/div_ui.c
+++ b/div_ui.c
@@ -89,6 +89,7 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode)
tmp = TMP_ALLOC((yn + 1) * BYTES_PER_MP_LIMB);
c = (mp_limb_t) u;
+ MPFR_ASSERTN(u == c);
if (dif >= 0)
c = mpn_divrem_1 (tmp, dif, xp, xn, c); /* used all the dividend */
else /* dif < 0 i.e. xn > yn, don't use the (-dif) low limbs from x */