Gnus development mailing list
 help / color / mirror / Atom feed
From: Norbert Koch <viteno@xemacs.org>
Subject: Re: Scoring out of bounds
Date: Sun, 02 Nov 2003 13:17:57 +0100	[thread overview]
Message-ID: <vz3cd7c6bu.fsf@redqueen.bytechase.cx> (raw)
In-Reply-To: <vzwuajcfro.fsf@redqueen.bytechase.cx> (Norbert Koch's message of "Sun, 02 Nov 2003 09:54:03 +0100")

Norbert Koch <viteno@xemacs.org> writes:

> Something's pushing scores up too high (my bad), but maybe it should
> be bound in gnus-decay-score to prevent such errors?

Here's a possible fix

Index: gnus-score.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-score.el,v
retrieving revision 6.35
diff -u -u -r6.35 gnus-score.el
--- gnus-score.el	13 Aug 2003 16:34:46 -0000	6.35
+++ gnus-score.el	2 Nov 2003 12:14:46 -0000
@@ -2918,13 +2918,15 @@
 
 (defun gnus-decay-score (score)
   "Decay SCORE according to `gnus-score-decay-constant' and `gnus-score-decay-scale'."
-  (floor
-   (- score
-      (* (if (< score 0) -1 1)
-	 (min (abs score)
-	      (max gnus-score-decay-constant
-		   (* (abs score)
-		      gnus-score-decay-scale)))))))
+  (condition-case nil
+      (floor
+       (- score
+	  (* (if (< score 0) -1 1)
+	     (min (abs score)
+		  (max gnus-score-decay-constant
+		       (* (abs score)
+			  gnus-score-decay-scale))))))
+    (arith-error most-positive-fixnum)))
 
 (defun gnus-decay-scores (alist day)
   "Decay non-permanent scores in ALIST."



  reply	other threads:[~2003-11-02 12:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-02  8:54 Norbert Koch
2003-11-02 12:17 ` Norbert Koch [this message]
2003-11-04  4:04   ` Katsumi Yamaoka
2003-11-04  5:49     ` Norbert Koch
2003-11-04  6:18       ` Katsumi Yamaoka
2003-11-19  6:48     ` Katsumi Yamaoka
2003-11-20  7:30       ` Norbert Koch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vz3cd7c6bu.fsf@redqueen.bytechase.cx \
    --to=viteno@xemacs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).