YoushouldhavereceivedcopiesoftheGNUGeneralPublicLicenseandthe GNULesserGeneralPublicLicensealongwiththeGNUMPLibrary.Ifnot,
see https://www.gnu.org/licenses/. */
#include"gmp-impl.h" #include"longlong.h"
mp_limb_t
mpn_gcd_11 (mp_limb_t u, mp_limb_t v)
{
ASSERT (u & v & 1);
/* In this loop, we represent the odd numbers ulimb and vlimb withouttheredundantleastsignificantonebit.Thisreduction insizebyonebitensuresthatthehighbitoft,below,isset
if and only if vlimb > ulimb. */
u >>= 1;
v >>= 1;
while (u != v)
{
mp_limb_t t;
mp_limb_t vgtu; int c;
t = u - v;
vgtu = LIMB_HIGHBIT_TO_MASK (t);
/* v <-- min (u, v) */
v += (vgtu & t);
/* u <-- |u - v| */
u = (t ^ vgtu) - vgtu;
count_trailing_zeros (c, t); /* We have c <= GMP_LIMB_BITS - 2 here, so that
ulimb>>=(c+1);
wouldbesafe.Butunliketheadditionc+1,aseparate shiftby1isindependentofc,andcanbeexecutedin
parallel with count_trailing_zeros. */
u = (u >> 1) >> c;
} return (u << 1) + 1;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.