From c7676c0b6b69d099c6880afb699593665d28fc96 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 3 Oct 2005 12:12:14 +0000 Subject: (MAX_N_FACTORS): Define in terms of sizeof (uintmax_t) rather than hard-coding to 128. From Thomas M.Ott. --- src/factor.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/factor.c') diff --git a/src/factor.c b/src/factor.c index 6578a7782..dc8f1cc87 100644 --- a/src/factor.c +++ b/src/factor.c @@ -42,9 +42,8 @@ /* Token delimiters when reading from a file. */ #define DELIM "\n\t " -/* FIXME: if this program is ever modified to factor integers larger - than 2^128, this constant (and the algorithm :-) will have to change. */ -#define MAX_N_FACTORS 128 +/* The maximum number of factors, including -1, for negative numbers. */ +#define MAX_N_FACTORS (sizeof (uintmax_t) * CHAR_BIT) /* The trial divisor increment wheel. Use it to skip over divisors that are composites of 2, 3, 5, 7, or 11. The part from WHEEL_START up to -- cgit v1.2.3-54-g00ecf