summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-08-12 18:47:51 +0200
committertomsmeding <tom.smeding@gmail.com>2017-08-12 18:48:05 +0200
commit3bae8d0bd075693a88563a225e8a2c2f3d248e76 (patch)
tree2fe70c4afce34d45fa26d74a877214fcaf213924
parentf98bf923d17a34d7833e9a8fe86b06faaef54bd7 (diff)
Indicate which intervals are closed and which are open
-rw-r--r--histogram.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/histogram.cpp b/histogram.cpp
index be6ec41..5bb2133 100644
--- a/histogram.cpp
+++ b/histogram.cpp
@@ -136,7 +136,7 @@ int main(int argc,char **argv){
int tally=histogram[i];
int width=BARWIDTH*tally/maxtally;
cout<<fullbar+BARWIDTH-width<<emptybar+width
- <<" ("<<setw(11)<<low+(double)i/nbins*(high-low)<<" - "<<setw(11)<<low+(double)(i+1)/nbins*(high-low)<<")"
+ <<" ["<<setw(11)<<low+(double)i/nbins*(high-low)<<" - "<<setw(11)<<low+(double)(i+1)/nbins*(high-low)<<")]"[i==(int)histogram.size()-1]
<<" ["<<tally<<"]"<<endl;
}
}