gcc/libstdc++-v3/testsuite/26_numerics
Jonathan Wakely 07e03761a7 libstdc++: Fix infinite loop in std::binomial_distribution [PR114359]
The multiplication (4 * _M_t * __1p) can wraparound to zero if _M_t is
unsigned and 4 * _M_t wraps to zero. The third operand has type double,
so do the second multiplication first, so that we aren't multiplying
integers.

libstdc++-v3/ChangeLog:

	PR libstdc++/114359
	* include/bits/random.tcc (binomial_distribution::param_type):
	Ensure arithmetic is done as type double.
	* testsuite/26_numerics/random/binomial_distribution/114359.cc: New test.
2024-03-19 15:59:44 +00:00
..
accumulate Update copyright years. 2024-01-03 12:19:35 +01:00
adjacent_difference Update copyright years. 2024-01-03 12:19:35 +01:00
bit Update copyright years. 2024-01-03 12:19:35 +01:00
complex Update copyright years. 2024-01-03 12:19:35 +01:00
endian Update copyright years. 2024-01-03 12:19:35 +01:00
exclusive_scan Update copyright years. 2024-01-03 12:19:35 +01:00
gcd Update copyright years. 2024-01-03 12:19:35 +01:00
headers Update copyright years. 2024-01-03 12:19:35 +01:00
inclusive_scan Update copyright years. 2024-01-03 12:19:35 +01:00
inner_product Update copyright years. 2024-01-03 12:19:35 +01:00
iota Update copyright years. 2024-01-03 12:19:35 +01:00
lcm Update copyright years. 2024-01-03 12:19:35 +01:00
lerp Update copyright years. 2024-01-03 12:19:35 +01:00
midpoint Update copyright years. 2024-01-03 12:19:35 +01:00
numbers Update copyright years. 2024-01-03 12:19:35 +01:00
partial_sum Update copyright years. 2024-01-03 12:19:35 +01:00
pstl/numeric_ops libstdc++: Synchronize PSTL with upstream 2023-06-26 11:34:43 -07:00
random libstdc++: Fix infinite loop in std::binomial_distribution [PR114359] 2024-03-19 15:59:44 +00:00
reduce Update copyright years. 2024-01-03 12:19:35 +01:00
saturation libstdc++: Define C++26 saturation arithmetic functions (P0543R3) 2023-11-17 15:28:30 +00:00
slice Update copyright years. 2024-01-03 12:19:35 +01:00
slice_array Update copyright years. 2024-01-03 12:19:35 +01:00
transform_exclusive_scan Update copyright years. 2024-01-03 12:19:35 +01:00
transform_inclusive_scan Update copyright years. 2024-01-03 12:19:35 +01:00
transform_reduce Update copyright years. 2024-01-03 12:19:35 +01:00
valarray libstdc++: Avoid aliasing violation in std::valarray [PR99117] 2024-02-15 11:43:21 +00:00