Assert that we have n>=2 samples
This commit is contained in:
parent
6146beb0f8
commit
28ea4871dc
1 changed files with 1 additions and 0 deletions
|
@ -27,6 +27,7 @@ double sample_variance(double set[], int set_n) {
|
|||
}
|
||||
|
||||
// Divide by (n-1), as this is *sample* variance (Bessel's correction).
|
||||
assert(set_n>1);
|
||||
ss /= (set_n-1);
|
||||
|
||||
return ss;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue