[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: minor bug found in factor 5.2.1
From: |
Paul Eggert |
Subject: |
Re: minor bug found in factor 5.2.1 |
Date: |
Tue, 07 Dec 2004 13:12:03 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Thomas Folz-Donahue <address@hidden> writes:
> When I tell it to factor 1, it returns 1 as a prime factor.
Thanks for reporting that. I installed this patch:
2004-12-07 Paul Eggert <address@hidden>
* src/factor.c (factor): Don't list 1 as a factor of 1.
Problem reported by Thomas Folz-Donahue.
Index: factor.c
===================================================================
RCS file: /fetish/cu/src/factor.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -p -u -r1.69 -r1.70
--- factor.c 17 Nov 2004 00:56:25 -0000 1.69
+++ factor.c 7 Dec 2004 21:11:59 -0000 1.70
@@ -101,7 +101,7 @@ factor (uintmax_t n0, size_t max_n_facto
size_t n_factors = 0;
unsigned char const *w = wheel_tab;
- if (n < 1)
+ if (n <= 1)
return n_factors;
/* The exit condition in the following loop is correct because