-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: ODF 1.2
-
Fix Version/s: ODF 1.3
-
Component/s: OpenFormula, Part 4 (Formula) [1.2: 2]
-
Labels:None
-
Environment:
N/A
-
Proposal:
I've been doing some research on missing spreadsheet function constraints, and I noticed that, in a couple of the OpenFormula statistical functions, there should be a constraint requiring population size to be greater than zero. All the existing implementations I tested already return an error in this instance, but it probably ought to be added to OpenFormula.
The functions affected are:
STDEVP (ODF 1.2 Part 2, 6.18.74)
STDEVPA (6.18.75)
VARPA (6.18.85)
I agree with Chris to add a constrain.
STDEVA has constrain "COUNTA(sample) > 1"
VARP has constrain "COUNT(N)>=1"
STDEV and VAR have constrain "At least two numbers shall be included. Returns an Error if less than two Numbers are provided."
VARA has constrain "The sequence shall contain two numbers at least."
I suggest to write it analogous.
STDEVP exchange "Constraints: None." with "Constraints: COUNT(N) >= 1."
STDEVPA exchange "Constraints: None." with "Constraints: COUNTA(sample) >= 1."
VARPA exchange "Constraints: None." with "Constraints: COUNTA(sample) >= 1."
The word "sample" in Chris' proposal "Constraints: Used sample size must be greater than zero." does not fit in case of STDEVP because it is a population and the argument identifier is N. In case of STDEVPA and VARPA it is possible, because it refers the argument identifier directly.
I think the corresponding D*** functions, e.g. DSTDEV, do not need constrains, because they are defined by reference to e.g. STDEV.