diff options
Diffstat (limited to 'mpz')
-rw-r--r-- | mpz/bin_uiui.c | 4 | ||||
-rw-r--r-- | mpz/oddfac_1.c | 4 | ||||
-rw-r--r-- | mpz/stronglucas.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/mpz/bin_uiui.c b/mpz/bin_uiui.c index c62e0ec2e..542d4858e 100644 --- a/mpz/bin_uiui.c +++ b/mpz/bin_uiui.c @@ -2,7 +2,7 @@ Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato. -Copyright 2010-2012, 2015-2018 Free Software Foundation, Inc. +Copyright 2010-2012, 2015-2018, 2020 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -584,7 +584,7 @@ limb_apprsqrt (mp_limb_t x) ASSERT (x > 2); count_leading_zeros (s, x); s = (GMP_LIMB_BITS - s) >> 1; - return ((CNST_LIMB(1) << s) + (x >> s)) >> 1; + return ((CNST_LIMB(1) << (s - 1)) + (x >> 1 >> s)); } static void diff --git a/mpz/oddfac_1.c b/mpz/oddfac_1.c index 904d3501a..e4da05cbf 100644 --- a/mpz/oddfac_1.c +++ b/mpz/oddfac_1.c @@ -7,7 +7,7 @@ IT IS ONLY SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE. -Copyright 2010-2012, 2015-2017 Free Software Foundation, Inc. +Copyright 2010-2012, 2015-2017, 2020 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -132,7 +132,7 @@ limb_apprsqrt (mp_limb_t x) ASSERT (x > 2); count_leading_zeros (s, x); s = (GMP_LIMB_BITS - s) >> 1; - return ((CNST_LIMB(1) << s) + (x >> s)) >> 1; + return ((CNST_LIMB(1) << (s - 1)) + (x >> 1 >> s)); } #if 0 diff --git a/mpz/stronglucas.c b/mpz/stronglucas.c index e9a71370e..cf9e7ff40 100644 --- a/mpz/stronglucas.c +++ b/mpz/stronglucas.c @@ -5,7 +5,7 @@ CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES. -Copyright 2018 Free Software Foundation, Inc. +Copyright 2018, 2020 Free Software Foundation, Inc. Contributed by Marco Bodrato. @@ -52,7 +52,7 @@ limb_apprsqrt (mp_limb_t x) ASSERT (x > 2); count_leading_zeros (s, x); s = (GMP_LIMB_BITS - s) >> 1; - return ((CNST_LIMB(1) << s) + (x >> s)) >> 1; + return ((CNST_LIMB(1) << (s - 1)) + (x >> 1 >> s)); } static int |