gcc/libstdc++-v3/include
Jonathan Wakely 4f75543dc4 PR libstdc++/61761 fix std::proj for targets without C99 cproj
The current generic implementation of __complex_proj used when cproj is
not available calculates the wrong projection, giving a different result
than given by C99's cproj.

When C99 cproj is not available but isinf and copysign are, use those to
give correct results for float, double and long double. Otherwise, and
for other specializations of std::complex, just use a generic version
that returns its argument, and so doesn't support infinities.

We might want to consider adding additional overloads of __complex_proj
to support extended types such as _Float64x, _Float128 etc.

	PR libstdc++/61761
	* include/std/complex (__complex_proj): Return parameter unchanged.
	[_GLIBCXX_USE_C99_COMPLEX] (__complex_proj): Change overloads for
	floating-point types to take std::complex arguments.
	[_GLIBCXX_USE_C99_MATH_TR1] (__complex_proj): Add overloads for
	floating-point types.
	* testsuite/26_numerics/complex/proj.cc: New test.

From-SVN: r270759
2019-05-01 01:08:36 +01:00
..
backward PR libstdc++/88066 Use <> for includes not "" 2019-03-21 12:07:10 +00:00
bits Adjust doxygen comment for std::generate_n 2019-04-29 14:31:50 +01:00
c Update copyright years. 2019-01-01 13:31:55 +01:00
c_compatibility In C++17 <math.h> should not put special functions in global namespace 2019-03-21 14:03:56 +00:00
c_global Define midpoint and lerp functions for C++20 (P0811R3) 2019-03-05 18:37:24 +00:00
c_std Update copyright years. 2019-01-01 13:31:55 +01:00
debug PR libstdc++/87431 re-adjust never-valueless optimizations 2019-04-05 17:56:09 +01:00
decimal Update copyright years. 2019-01-01 13:31:55 +01:00
experimental Remove redundant step in experimental::filesystem::path construction 2019-04-26 16:58:47 +01:00
ext Disambiguate __gnu_cxx::append_ partial specialization 2019-02-22 01:15:58 +00:00
parallel PR libstdc++/88607 replace or remove unnecessary UTF-8 characters 2019-01-03 20:38:11 +00:00
precompiled Update copyright years. 2019-01-01 13:31:55 +01:00
profile Fix after P0600. 2019-01-21 11:47:30 +00:00
pstl Cleanup algorithm implementations 2019-04-20 22:45:58 +00:00
std PR libstdc++/61761 fix std::proj for targets without C99 cproj 2019-05-01 01:08:36 +01:00
tr1 PR libstdc++/88066 Use <> for includes not "" 2019-03-21 12:07:10 +00:00
tr2 Fix after P0600. 2019-01-21 11:47:30 +00:00
Makefile.am Integrate C++17 parallel algorithms 2019-03-21 23:48:49 +00:00
Makefile.in Integrate C++17 parallel algorithms 2019-03-21 23:48:49 +00:00