Skip to content

Commit e341091

Browse files
committed
Use std::lround instead of int(std::round) in sample code (suggested by david-fong)
1 parent 8d6bf4b commit e341091

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sample/cppref-sample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ int main()
6363

6464
std::map<int, int> hist;
6565
for (int n = 0; n < 10000; ++n) {
66-
++hist[int(std::round(normal_dist(rng)))];
66+
++hist[std::lround(normal_dist(rng))];
6767
}
6868
std::cout << "Normal distribution around " << mean << ":\n";
6969
for (auto p : hist) {

0 commit comments

Comments
 (0)