From: Paul Eggert Date: Sat, 31 May 2025 20:09:02 +0000 (-0700) Subject: factor: add comments X-Git-Tag: v9.8~228 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e438e369c365732ce2751f159d4720c3ffbe313;p=thirdparty%2Fcoreutils.git factor: add comments --- diff --git a/src/factor.c b/src/factor.c index 2cf2ecde38..3ffd0f2dba 100644 --- a/src/factor.c +++ b/src/factor.c @@ -281,16 +281,26 @@ static_assert (2 * W_TYPE_SIZE - 1 <= UCHAR_MAX); /* Likewise for recording the number of prime factors. */ static_assert (MAX_NFACTS <= UCHAR_MAX); +/* Prime factors of a uuint. At most one is a uuint. */ struct factors { - uuint plarge; /* Can have a single large factor */ + /* If PLARGE.uu[1] is nonzero, PLARGE is a double-word prime factor + with multiplicity 1; otherwise, PLARGE is not a factor and + PLARGE.uu[0] might not be initialized. */ + uuint plarge; + + /* Distinct single-word prime factors, their multiplicities, + and their number. */ mp_limb_t p[MAX_NFACTS]; unsigned char e[MAX_NFACTS]; unsigned char nfactors; }; +/* Prime factors of an mpz_t. */ struct mp_factors { + /* Distinct prime factors, their multiplicities, their number, and + the size of the arrays allocated for the factors and multiplicities. */ mpz_t *p; mp_bitcnt_t *e; idx_t nfactors;