[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PSPP-BUG: Re: [bugs #12035] AGGREGATE gets its sums wrong!
From: |
Ben Pfaff |
Subject: |
Re: PSPP-BUG: Re: [bugs #12035] AGGREGATE gets its sums wrong! |
Date: |
Fri, 25 Feb 2005 21:04:51 -0800 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) |
John Darrington <address@hidden> writes:
> On closer inspection, this bug is not a problem with AGGREGATE, but
> with the DATA LIST.
>
>
>
> So far as I can tell, the offending code is:
>
> RCS file: /cvsroot/pspp/pspp/src/data-in.c,v
> retrieving revision 1.12
> diff -b -w -r1.12 data-in.c
> 218,219d217
> < else if (!got_dot)
> < exponent -= i->format.d;
>
> I can't see any good reason for these lines.
By way of explanation, here is what the SPSS manual says:
Implied Decimal Positions
ยท For fixed-format data, decimal positions can be coded in
the data or implied by the format. If decimal positions
are implied but are not entered in the data, the program
inter- prets the rightmost digits in each value as the
decimal digits. A coded decimal point in a value
overrides the number of implied decimal places. For
example, (DOLLAR,2) specifies two decimal positions. The
value 123 is interpreted as 1.23; however, the value
12.3 is interpreted as 12.3 because the coded decimal
position overrides the number of implied decimal
positions.
Here is what the PSPP manual says:
In addition, implied decimal places can be specified in parentheses
after the column numbers. As an example, suppose that a data file has a
field in which the characters `1234' should be interpreted as having
the value 12.34. Then this field has two implied decimal places, and
the corresponding specification would be `(2)'. If a field that has
implied decimal places contains a decimal point, then the implied
decimal places are not applied.
It looks like the PSPP manual needs to say something similar
about FORTRAN style. I will fix up the documentation.
> When I remove them, the problem goes away, and it passes all
> tests except:
The problem is, I believe, that we're applying implied decimal
places to free-format data, but it is only applicable for
fixed-format data.
If you want to fix this, go ahead; otherwise, I will do it when I
am done with the expression changes, which I still plan to commit
by the end of the month.
--
On Perl: "It's as if H.P. Lovecraft, returned from the dead and speaking by
seance to Larry Wall, designed a language both elegant and terrifying for his
Elder Things to write programs in, and forgot that the Shoggoths didn't turn
out quite so well in the long run." --Matt Olson