summaryrefslogtreecommitdiff
path: root/stddev.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'stddev.cpp')
-rw-r--r--stddev.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/stddev.cpp b/stddev.cpp
index b652b8a..ee36af4 100644
--- a/stddev.cpp
+++ b/stddev.cpp
@@ -32,6 +32,7 @@ int main(int,char **argv){
sort(data.begin(),data.end());
+ const double s_count=data.size();
const double s_mean=total/data.size();
const double s_median=data[data.size()/2];
@@ -42,7 +43,8 @@ int main(int,char **argv){
const double s_stddev=data.size()==1?nan(""):sqrt(total/(data.size()-1));
const double s_stderr=s_stddev/sqrt(data.size());
- cout<<"Mean: "<<s_mean<<'\n'
+ cout<<"Count: "<<s_count<<'\n'
+ <<"Mean: "<<s_mean<<'\n'
<<"Stddev: "<<s_stddev<<'\n'
<<"Stderr: "<<s_stderr<<'\n'
<<"Median: "<<s_median<<endl;