commit 6c51568b90317998a4ef71291125769d3c467211
parent 51562c331a25a3c3548fb5d4d84cd9fd31aeafb2
Author: sin <sin@2f30.org>
Date: Fri, 12 Jun 2015 14:58:50 +0100
Bump freq from int to long
There are cases where freq can have very large values (30-40 million
or so). The loop in adjmeans() can overflow because the multiplication
happens with int types.
This bug made the algorithm not converge for some data sets.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/colors.c b/colors.c
@@ -17,7 +17,7 @@ struct point {
int x;
int y;
int z;
- int freq;
+ long freq;
struct cluster *c;
TAILQ_ENTRY(point) e;
RB_ENTRY(point) rb_e;