Closed (fixed)
Project:
Webform
Version:
7.x-4.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
24 Feb 2014 at 21:54 UTC
Updated:
5 May 2014 at 05:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
danchadwick commentedThis patch fixes the bug and cleans up the code a bit.
1) Counts negative number in statistics.
2) Renames $nonzero and $not_empty to $non_zero and $non_empty for consistency.
3) Uses (float)$value to handle empty strings. No special handling is needed: http://www.php.net/manual/en/language.types.string.php#language.types.st...
The only slight remaining weirdness that I see is that the option to consider empty/zero is used to switch from a straight std dev to a sample std dev by dividing by N-1. I'm not sure that this is justified, especially in the case where there are no non-empty value. See http://en.wikipedia.org/wiki/Standard_deviation. If it's thought that this isn't the best solution, another issue should be created. I don't purport to be a statistics expert.
Comment #2
danchadwick commentedCommitted #1 to 7.x-4.x and backported to 7.x-3.x and 6.x
Comment #4
fenstratNeeds porting to 8.x-4.x.
Comment #5
fenstratCommitted and pushed 7197be5 to 8.x-4.x. Thanks!