diff options
-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; } |