diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-05-17 20:36:38 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-05-17 20:36:38 +0200 |
commit | d71b1fe6d65e72f9a4f3f81ffe06124d1f60458c (patch) | |
tree | a85ae9662cfd368f22f6422ada4e985a5c8a4e83 | |
parent | 4b365556736a5316767fb5adac51b44bde0a077f (diff) |
Output number of input points
-rw-r--r-- | stddev.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |