summaryrefslogtreecommitdiff
path: root/mpz/cmp_ui.c
diff options
context:
space:
mode:
authortege <tege@gmplib.org>2002-04-27 02:36:41 +0200
committertege <tege@gmplib.org>2002-04-27 02:36:41 +0200
commit02788dd3e027f6a7c642a69b2324906488bb388a (patch)
tree2fbc9ba8735caf183e1790a152dfbeed4c8ee4bc /mpz/cmp_ui.c
parenta814007de302f5fdeab000286aa3239e2c679236 (diff)
downloadgmp-02788dd3e027f6a7c642a69b2324906488bb388a.tar.gz
Fix overflow conditions for nails.
Diffstat (limited to 'mpz/cmp_ui.c')
-rw-r--r--mpz/cmp_ui.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mpz/cmp_ui.c b/mpz/cmp_ui.c
index 30a0722de..018177838 100644
--- a/mpz/cmp_ui.c
+++ b/mpz/cmp_ui.c
@@ -53,6 +53,9 @@ _mpz_cmp_ui (mpz_srcptr u, unsigned long int v_digit)
{
ul = up[0] + (up[1] << GMP_NUMB_BITS);
+ if ((up[1] >> GMP_NAIL_BITS) != 0)
+ return 1;
+
if (ul > v_digit)
return 1;
if (ul < v_digit)