Assert that we have n>=2 samples

master
neingeist 11 years ago
parent 6146beb0f8
commit 28ea4871dc

@ -27,6 +27,7 @@ double sample_variance(double set[], int set_n) {
} }
// Divide by (n-1), as this is *sample* variance (Bessel's correction). // Divide by (n-1), as this is *sample* variance (Bessel's correction).
assert(set_n>1);
ss /= (set_n-1); ss /= (set_n-1);
return ss; return ss;

Loading…
Cancel
Save