@@ -53,12 +53,16 @@ int main(int, char**) {
53
53
edges can be accessed with methods `lower()` and `upper()`, but the
54
54
implementation depends on the axis, please look it up in the reference
55
55
*/
56
+ std::cout.setf (std::ios_base::fixed);
56
57
for (auto it = h.begin (); it != h.end (); ++it) {
57
58
const auto bin = it.bin (0_c);
58
59
std::cout << " bin " << it.idx (0 ) << " x in ["
59
- << bin.lower () << " , " << bin.upper () << " ): "
60
+ << std::setprecision (1 )
61
+ << std::setw (4 ) << bin.lower () << " , "
62
+ << std::setw (4 ) << bin.upper () << " ): "
63
+ << std::setprecision (1 )
60
64
<< it->value () << " +/- "
61
- << std::sqrt (it->variance ())
65
+ << std::setprecision ( 3 ) << std:: sqrt (it->variance ())
62
66
<< std::endl;
63
67
}
64
68
@@ -68,7 +72,7 @@ int main(int, char**) {
68
72
bin 1 x in [-0.5, 0.0): 0 +/- 0
69
73
bin 2 x in [ 0.0, 0.5): 1 +/- 1
70
74
bin 3 x in [ 0.5, 1.0): 0 +/- 0
71
- bin 4 x in [ 1.0, 1.5): 1 +/- 1
75
+ bin 4 x in [ 1.0, 1.5): 0 +/- 0
72
76
bin 5 x in [ 1.5, 2.0): 0 +/- 0
73
77
bin 6 x in [ 2.0, inf): 2 +/- 1.41421
74
78
bin -1 x in [-inf, -1): 1 +/- 1
0 commit comments