You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by hs...@apache.org on 2004/08/04 05:00:21 UTC

svn commit: rev 35659 - spamassassin/trunk/masses

Author: hstern
Date: Tue Aug  3 20:00:21 2004
New Revision: 35659

Modified:
   spamassassin/trunk/masses/perceptron.c
Log:
Trivial floating point arithmetic fix.



Modified: spamassassin/trunk/masses/perceptron.c
==============================================================================
--- spamassassin/trunk/masses/perceptron.c	(original)
+++ spamassassin/trunk/masses/perceptron.c	Tue Aug  3 20:00:21 2004
@@ -95,11 +95,12 @@
 		 * most important to classify correctly.  They are thus replicated in the
 		 * training set proportionally to their difficulty. */
 		if ( ! is_spam[i] ) {
-			slot_size += (int)(num_tests_hit[i] * ham_preference);
+			slot_size += (int)(num_tests_hit[i] * ham_preference * tests_count[i]);
+		} else {
+			slot_size = tests_count[i];
 		}
 
 		/* The database is compressed with all instances mapped in the same place. */
-		slot_size *= tests_count[i];
 		wheel_size += slot_size;
 
 		if ( ! is_spam[i] ) {