COUNT didn't properly handle user-missing values or the MISSING
keyword. This corrects the problem.
Thanks to ftr <news.ftr@free.fr> for reporting this bug.
Bug #44157.
PSPP NEWS -- history of user-visible changes.
PSPP NEWS -- history of user-visible changes.
-Copyright (C) 1996-2000, 2008-2014 Free Software Foundation, Inc.
+Copyright (C) 1996-2000, 2008-2015 Free Software Foundation, Inc.
See the end for copying conditions.
Please send PSPP bug reports to bug-gnu-pspp@gnu.org.
See the end for copying conditions.
Please send PSPP bug reports to bug-gnu-pspp@gnu.org.
- Planned comparisons in ONEWAY ANOVA now correctly handle negative
T-values.
- Planned comparisons in ONEWAY ANOVA now correctly handle negative
T-values.
+ - The COUNT command now correctly treats missing values as
+ documented.
+
- Conformance fixes to Open Document output format.
Changes from 0.8.2 to 0.8.3:
- Conformance fixes to Open Document output format.
Changes from 0.8.2 to 0.8.3:
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if (lex_match_id (lexer, "SYSMIS"))
crit->count_system_missing = true;
else if (lex_match_id (lexer, "MISSING"))
if (lex_match_id (lexer, "SYSMIS"))
crit->count_system_missing = true;
else if (lex_match_id (lexer, "MISSING"))
- crit->count_user_missing = true;
+ crit->count_system_missing = crit->count_user_missing = true;
else if (parse_num_range (lexer, &low, &high, NULL))
{
struct num_value *cur;
else if (parse_num_range (lexer, &low, &high, NULL))
{
struct num_value *cur;
for (i = 0; i < crit->var_cnt; i++)
{
double x = case_num (c, crit->vars[i]);
for (i = 0; i < crit->var_cnt; i++)
{
double x = case_num (c, crit->vars[i]);
- if (var_is_num_missing (crit->vars[i], x, MV_ANY))
- {
- if (x == SYSMIS
- ? crit->count_system_missing
- : crit->count_user_missing)
+ struct num_value *v;
+
+ for (v = crit->values.num; v < crit->values.num + crit->value_cnt;
+ v++)
+ if (v->type == CNT_SINGLE ? x == v->a : x >= v->a && x <= v->b)
+ {
+ break;
+ }
+
+ if (var_is_num_missing (crit->vars[i], x, MV_ANY)
+ && (x == SYSMIS
+ ? crit->count_system_missing
+ : crit->count_user_missing))
- struct num_value *v;
-
- for (v = crit->values.num; v < crit->values.num + crit->value_cnt;
- v++)
- if (v->type == CNT_SINGLE ? x == v->a : x >= v->a && x <= v->b)
- {
- counter++;
- break;
- }
AT_SETUP([COUNT -- numeric data])
AT_DATA([count.sps], [dnl
AT_SETUP([COUNT -- numeric data])
AT_DATA([count.sps], [dnl
-DATA LIST LIST /x * y *.
BEGIN DATA.
1 2
2 3
4 5
2 2
5 6
BEGIN DATA.
1 2
2 3
4 5
2 2
5 6
+MISSING VALUES x(7)/y(3).
+
+COUNT c=x y (2)/d=x y(7)/e=x y(missing)/f=x y(sysmis).
+
+FORMATS ALL(F1).
-x,y,c
-1.00,2.00,1.00
-2.00,3.00,1.00
-4.00,5.00,.00
-2.00,2.00,2.00
-5.00,6.00,.00
+x,y,c,d,e,f
+1,2,1,0,0,0
+2,3,1,0,1,0
+4,5,0,0,0,0
+2,2,2,0,0,0
+5,6,0,0,0,0
+7,2,1,1,1,0
+.,2,1,0,1,1