Jonathan Wakely
099d469df6
libstdc++: Fix std::abs(__float128) for -NaN and -0.0 [PR109758]
...
The current implementation of this non-standard overload of std::abs
incorrectly returns a negative value for negative NaNs and negative
zero, because x < 0 is false in both cases.
Use fabsl(long double) or fabsf128(_Float128) if those do the right
thing. Otherwise, use __builtin_signbit(x) instead of x < 0 to detect
negative inputs. This assumes that __builtin_signbit handles __float128
correctly, but that seems to be true for all of GCC, clang and icc.
libstdc++-v3/ChangeLog:
PR libstdc++/109758
* include/bits/std_abs.h (abs(__float128)): Handle negative NaN
and negative zero correctly.
* testsuite/26_numerics/headers/cmath/109758.cc: New test.
(cherry picked from commit af595613acbd9863198ae69c7b1c9e856bca9e4f)
2023-06-01 18:11:08 +01:00
..
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-03-13 10:32:26 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-02-27 13:42:21 +00:00
2023-01-16 11:52:17 +01:00
2023-05-11 21:30:00 +01:00
2023-05-11 21:30:00 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-05 18:45:14 +02:00
2023-03-28 21:12:18 +01:00
2023-01-16 11:52:17 +01:00
2023-01-14 16:59:58 +00:00
2023-03-14 10:28:38 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-28 13:31:52 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-28 13:31:52 +01:00
2023-01-16 11:52:17 +01:00
2023-04-28 13:31:52 +01:00
2023-01-16 11:52:17 +01:00
2023-02-16 10:24:45 +00:00
2023-04-28 13:31:52 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-27 11:35:02 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-27 11:35:02 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-03-28 23:51:47 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-27 11:35:02 +01:00
2023-04-28 18:21:17 -04:00
2023-04-28 13:31:53 +01:00
2023-01-16 11:52:17 +01:00
2023-04-27 11:35:04 +01:00
2022-06-27 11:08:16 +01:00
2023-04-28 13:33:20 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-03-28 23:51:47 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-05 18:45:14 +02:00
2023-04-28 13:31:52 +01:00
2023-04-28 13:33:31 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-18 07:24:19 -04:00
2023-01-16 11:52:17 +01:00
2023-04-14 10:32:12 -04:00
2023-04-18 07:24:21 -04:00
2023-01-16 11:52:17 +01:00
2023-04-14 10:32:12 -04:00
2023-01-16 11:52:17 +01:00
2023-02-16 10:24:45 +00:00
2023-02-16 10:24:45 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-02-16 10:24:45 +00:00
2023-04-05 11:37:19 +01:00
2023-04-28 13:33:29 +01:00
2022-10-03 15:43:48 +01:00
2023-01-16 11:52:17 +01:00
2023-03-22 23:13:40 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-27 11:35:02 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-06-01 18:11:08 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-03-03 16:06:44 -03:00
2023-01-16 11:52:17 +01:00
2023-02-28 09:49:11 +00:00
2023-04-28 13:31:52 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-14 10:32:12 -04:00
2023-01-16 11:52:17 +01:00
2023-04-28 13:31:52 +01:00
2023-04-28 13:31:52 +01:00
2023-04-28 13:31:52 +01:00
2023-01-16 11:52:17 +01:00
2023-02-16 14:38:38 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-28 13:31:52 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-26 13:38:22 +00:00
2023-01-16 11:52:17 +01:00
2023-04-28 13:31:52 +01:00
2023-03-22 17:48:19 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-04-28 13:33:31 +01:00
2023-01-16 11:52:17 +01:00
2023-04-05 18:45:14 +02:00
2023-04-28 13:31:52 +01:00
2023-04-28 13:31:52 +01:00
2023-02-28 09:49:11 +00:00
2023-04-28 13:33:29 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00