https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88849
Bug ID: 88849 Summary: std::binomial_distribution generates slightly larger values than expected Product: gcc Version: 8.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: heavy.watal at gmail dot com Target Milestone: --- Created attachment 45430 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45430&action=edit Visualization of the distribution difference Here is a reproducible example: https://github.com/heavywatal/scribble/tree/master/cxx/binomial The sum of 10000 values from std::binomial_distribution(1000, 0.01) was calculated 1000 times. Those from libstdc++ are slightly larger than expected. Environment: macOS 10.14.2 g++-8 -v Using built-in specs. COLLECT_GCC=g++-8 COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/8.2.0/libexec/gcc/x86_64-apple-darwin18.0.0/8.2.0/lto-wrapper Target: x86_64-apple-darwin18.0.0 Configured with: ../configure --build=x86_64-apple-darwin18.0.0 --prefix=/usr/local/Cellar/gcc/8.2.0 --libdir=/usr/local/Cellar/gcc/8.2.0/lib/gcc/8 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-8 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 8.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk Thread model: posix gcc version 8.2.0 (Homebrew GCC 8.2.0)