summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2012-10-23 12:08:58 +0200
committerJim Meyering <jim@meyering.net>2012-10-23 14:24:02 +0200
commitb8778bb18650bdca6792b17dacdfa92ea788ded2 (patch)
tree6e9ec636d6517bb681035b2c11f4d9fe8918ae0b /src
parent22ba81b2526cb55b4f0d860dcc471872031a7fa8 (diff)
downloadcoreutils-b8778bb18650bdca6792b17dacdfa92ea788ded2.tar.xz
factor: add comments
* src/factor.c (is_square): Use active voice in comment, not passive. (factor): Add function-describing comment. (mp_factor): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/factor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/factor.c b/src/factor.c
index d38c5838c..4c2af9811 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -1801,7 +1801,7 @@ isqrt2 (uintmax_t nh, uintmax_t nl)
#define MAGIC65 ((uint64_t) 0x218a019866014613ULL)
#define MAGIC11 0x23b
-/* Returns the square root if the input is a square, otherwise 0. */
+/* Return the square root if the input is a square, otherwise 0. */
static uintmax_t _GL_ATTRIBUTE_CONST
is_square (uintmax_t x)
{
@@ -2176,6 +2176,8 @@ factor_using_squfof (uintmax_t n1, uintmax_t n0, struct factors *factors)
return false;
}
+/* Compute the prime factors of the 128-bit number (T1,T0), and put the
+ results in FACTORS. Use the algorithm selected by the global ALG. */
static void
factor (uintmax_t t1, uintmax_t t0, struct factors *factors)
{
@@ -2206,6 +2208,8 @@ factor (uintmax_t t1, uintmax_t t0, struct factors *factors)
}
#if HAVE_GMP
+/* Use Pollard-rho to compute the prime factors of
+ arbitrary-precision T, and put the results in FACTORS. */
static void
mp_factor (mpz_t t, struct mp_factors *factors)
{