[Gmp-commit] /var/hg/gmp: mini-gmp/mini-gmp.c: use constants in conditions

mercurial at gmplib.org mercurial at gmplib.org
Fri Dec 21 06:22:25 UTC 2018


details:   /var/hg/gmp/rev/a6330486a8cd
changeset: 17738:a6330486a8cd
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Fri Dec 21 07:21:55 2018 +0100
description:
mini-gmp/mini-gmp.c: use constants in conditions

diffstat:

 mini-gmp/mini-gmp.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 37d769986c8f -r a6330486a8cd mini-gmp/mini-gmp.c
--- a/mini-gmp/mini-gmp.c	Fri Dec 21 01:07:08 2018 +0100
+++ b/mini-gmp/mini-gmp.c	Fri Dec 21 07:21:55 2018 +0100
@@ -769,12 +769,12 @@
 mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0)
 {
   int GMP_LIMB_BITS_MUL_3 = GMP_LIMB_BITS * 3;
-  if (sizeof (unsigned) * CHAR_BIT > GMP_LIMB_BITS_MUL_3)
+  if (sizeof (unsigned) * CHAR_BIT > GMP_LIMB_BITS * 3)
     {
       return (((unsigned) 1 << GMP_LIMB_BITS_MUL_3) - 1) /
 	(((unsigned) u1 << GMP_LIMB_BITS_MUL_3 / 3) + u0);
     }
-  else if (GMP_ULONG_BITS > GMP_LIMB_BITS_MUL_3)
+  else if (GMP_ULONG_BITS > GMP_LIMB_BITS * 3)
     {
       return (((unsigned long) 1 << GMP_LIMB_BITS_MUL_3) - 1) /
 	(((unsigned long) u1 << GMP_LIMB_BITS_MUL_3 / 3) + u0);


More information about the gmp-commit mailing list