Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
binomial_distribution: mitigate undocumented behaviour
In param_type::_M_initialize(): Change integer literal to corresponding floating-point literal in multiplication by _M_t to avoid unsigned overflow and consequent chain of unpredicted behaviour
- Loading branch information
0d79c40
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In particular, for values of _M_t that overflow to 0 by the 4* multiplication, the operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) hangs in an infinite loop as noted and described on https://stackoverflow.com/q/75179395/15114624