Mailing List Archive

No, hits=5.0 required=5.0 !!
Got a strange FN:


X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on intranet.ffvl.fr
X-Spam-Level: ****
X-Spam-Status: No, hits=5.0 required=5.0 tests=HTML_20_30,HTML_MESSAGE,
LG_4C_2V_3C,LINES_OF_YELLING,OACYS_CONS_6,RCVD_IN_BL_SPAMCOP_NET,
RCVD_IN_DSBL,RCVD_IN_SORBS,RM_rb_ANCHOR,RM_rb_BODY,RM_rb_BREAK,
RM_rb_DIV,RM_rb_FONT,RM_rb_HTML,RM_rb_PARA,RM_rb_TITLE autolearn=no
version=2.63


Rounding error ?


BEst,
--
Christian Quest (cquest@cquest.org)
Les cotes - 74910 Seyssel (France) Mobile: +33 6 09 04 01 56
Web: http://www.cquest.org/cq/ iChat/AIM: cricrixquest
RE: No, hits=5.0 required=5.0 !! [ In reply to ]
It's probably 4.96-4.99. It just gets rounded to one decimal place in
the report. I read somewhere that the X-Spam-Level is not rounded it's
truncated (for good reason).

-----Original Message-----
From: Christian Quest [mailto:lists@cquest.org]
Sent: Monday, February 09, 2004 11:36 AM
To: spamassassin-users@incubator.apache.org
Subject: No, hits=5.0 required=5.0 !!

Got a strange FN:


X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on
intranet.ffvl.fr
X-Spam-Level: ****
X-Spam-Status: No, hits=5.0 required=5.0 tests=HTML_20_30,HTML_MESSAGE,

LG_4C_2V_3C,LINES_OF_YELLING,OACYS_CONS_6,RCVD_IN_BL_SPAMCOP_NET,
RCVD_IN_DSBL,RCVD_IN_SORBS,RM_rb_ANCHOR,RM_rb_BODY,RM_rb_BREAK,
RM_rb_DIV,RM_rb_FONT,RM_rb_HTML,RM_rb_PARA,RM_rb_TITLE
autolearn=no
version=2.63


Rounding error ?


BEst,
--
Christian Quest (cquest@cquest.org)
Les cotes - 74910 Seyssel (France) Mobile: +33 6 09 04 01 56
Web: http://www.cquest.org/cq/ iChat/AIM: cricrixquest
Re: No, hits=5.0 required=5.0 !! [ In reply to ]
On Mon, Feb 09, 2004 at 11:39:26AM -0500, Mark A. DeMichele wrote:
> It's probably 4.96-4.99. It just gets rounded to one decimal place in
> the report. I read somewhere that the X-Spam-Level is not rounded it's
> truncated (for good reason).

This stuff is in the FAQ. As for X-Spam-Level, it's truncated because
you can't have a fraction number of characters... "*"x4.7 just gives
you 4 via int().

The report value is rounded via printf(). :)

--
Randomly Generated Tagline:
"Unix aint perfect - but it's light years ahead of Windows NT" - Unknown
RE: No, hits=5.0 required=5.0 !! [ In reply to ]
> From: Theo Van Dinter [mailto:felicity@kluge.net]
> On Mon, Feb 09, 2004 at 11:39:26AM -0500, Mark A. DeMichele wrote:
> > It's probably 4.96-4.99. It just gets rounded to one
> decimal place in
> > the report. I read somewhere that the X-Spam-Level is not
> rounded it's
> > truncated (for good reason).
>
> This stuff is in the FAQ. As for X-Spam-Level, it's truncated because
> you can't have a fraction number of characters... "*"x4.7 just gives
> you 4 via int().
>
> The report value is rounded via printf(). :)

Stupid question -
why not truncate the decimal number as well? Or go to a higher degree of
precision in the printf (say, three decimal places?)

Adding one decimal place will cause this "bug" to happen one-tenth of the
time it does now. Adding two will cause it to happen one one-hundredth.

Or it could be eliminated forever with a construct like

$hits_display =
"" . # force stringiness
(int($hits * 1000) / 1000); # show three decimal places (round down)

(Substitute 10 for 1000 if you prefer one decimal place, 100 if you prefer
two)

Matthew van Eerde
Software Engineer
Hispanic Business Inc.
HireDiversity.com
805.964.4554 x902
Matthew.van.Eerde@hbinc.com
http://www.hispanicbusiness.com
http://www.hirediversity.com
RE: No, hits=5.0 required=5.0 !! [ In reply to ]
At 12:37 PM 2/9/2004, Matthew.van.Eerde@hbinc.com wrote:
>why not truncate the decimal number as well?

Ahh, but round down causes problems too..

Fundamentally _any_ kind of rounding causes an "error" in one direction or
another. There's tons of different "round" methods that are all standard
(force down, force up, statistical and bankers rounding, to name a few.)
and they ALL introduce an error. The fact that you are rounding by the very
nature of rounding MUST introduce error.

I'd have to say that if people can't understand rounding, well, they can't
understand rounding. Changing they type of rounding only changes the type
of error and doesn't fix anything it only fixes one problem case while
creating another.


>Adding one decimal place will cause this "bug" to happen one-tenth of the
>time it does now. Adding two will cause it to happen one one-hundredth.

Agreed, higher precision will make it go away.. However, changing the
format of the spam-status line would likely break some tools that try to
parse it. It also adds clutter factor.

>Or it could be eliminated forever with a construct like
>
>$hits_display =
> "" . # force stringiness
> (int($hits * 1000) / 1000); # show three decimal places (round down)



You might want to read some of the discussion in the many duplicate bug
submissions about this.

http://bugzilla.spamassassin.org/show_bug.cgi?id=2498

http://bugzilla.spamassassin.org/show_bug.cgi?id=2659

http://bugzilla.spamassassin.org/show_bug.cgi?id=2830