diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2019-09-23 13:43:37 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2019-09-23 13:43:37 +0200 |
commit | 15d140092bff4ce56caee1f7f50ef588e226fec4 (patch) | |
tree | 2c98c50ade62f188414658933f09b4f1766f7630 | |
parent | e34bdab2d6725543be5a040bd1bdaeebd675f96b (diff) |
-rw-r--r-- | stddev.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -50,6 +50,8 @@ int main(int,char **argv){ const double s_count=data.size(); const double s_mean=total/data.size(); const double s_median=data[data.size()/2]; + const double s_min=data[0]; + const double s_max=data[data.size()-1]; total=0; for(double v : data){ @@ -62,5 +64,6 @@ int main(int,char **argv){ <<"Mean: "<<s_mean<<'\n' <<"Stddev: "<<s_stddev<<'\n' <<"Stderr: "<<s_stderr<<'\n' - <<"Median: "<<s_median<<endl; + <<"Median: "<<s_median<<'\n' + <<"Range: ["<<s_min<<","<<s_max<<"]"<<endl; } |