[cvs] bogofilter/src xatof.c,1.1,1.2 xatoi.c,1.1,1.2 xatox.h,1.1,1.2

Matthias Andree matthias.andree at gmx.de
Tue Mar 4 12:53:27 CET 2003


Greg Louis <glouis at dynamicro.on.ca> writes:

> But why, is the question?  spam_cutoff's a double; why feed it a float
> value (that gets converted anyway)?  (I've been wondering for months
> about all those f's scattered through the code, but I've been too lazy
> to rauss them systematically.)

The most interesting issue is: why are they in the configuration file in
the first place?

Before my code changes, we used the atof function to parse the values,
and quoting the GNU atof(3) manual page:

       The  atof()  function  converts the initial portion of the
       string pointed to by nptr to double.

So it was useless in the first place.

> I suppose, just to be friendly to non-C types, one could accept and
> ignore f in config files -- but non-C types wouldn't expect to put f
> at the end of a number anyhow.

At the end of a double at least. If you had large tables of
low-precision floats, then you might put a "f" into these constants, but
now that bogofilter has settled for "double" (and I believe it has for
good), we should kill the f in the code. They are useless and might even
bloat the code when compiled without optimization.

-- 
Matthias Andree




More information about the bogofilter-dev mailing list