public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/61761] [C++11] std::proj returns incorrect values
       [not found] <bug-61761-4@http.gcc.gnu.org/bugzilla/>
@ 2015-04-09 15:41 ` redi at gcc dot gnu.org
  2020-03-10 15:39 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-09 15:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61761

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-04-09
     Ever confirmed|0                           |1
           Severity|normal                      |minor

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I suppose something like this isn't usable because it won't work unless _Tp is
float, double or long double:

--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -1887,11 +1887,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     std::complex<_Tp>
     __complex_proj(const std::complex<_Tp>& __z)
     {
-      const _Tp __den = (__z.real() * __z.real()
-                        + __z.imag() * __z.imag() + _Tp(1.0));
-
-      return std::complex<_Tp>((_Tp(2.0) * __z.real()) / __den,
-                              (_Tp(2.0) * __z.imag()) / __den);
+      if (isinf(__z.real()) || isinf(__z.imag())
+         || isnan(__z.real()) || isnan(__z.imag()))
+       return std::complex<_Tp>(INFINITY, copysign(0.0, __z.imag()));
+      return __z;
     }

 #if _GLIBCXX_USE_C99_COMPLEX


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/61761] [C++11] std::proj returns incorrect values
       [not found] <bug-61761-4@http.gcc.gnu.org/bugzilla/>
  2015-04-09 15:41 ` [Bug libstdc++/61761] [C++11] std::proj returns incorrect values redi at gcc dot gnu.org
@ 2020-03-10 15:39 ` redi at gcc dot gnu.org
  2020-03-12 11:58 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2020-03-10 15:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61761

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reopening due to the failing test.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/61761] [C++11] std::proj returns incorrect values
       [not found] <bug-61761-4@http.gcc.gnu.org/bugzilla/>
  2015-04-09 15:41 ` [Bug libstdc++/61761] [C++11] std::proj returns incorrect values redi at gcc dot gnu.org
  2020-03-10 15:39 ` redi at gcc dot gnu.org
@ 2020-03-12 11:58 ` jakub at gcc dot gnu.org
  2021-06-01  8:06 ` rguenth at gcc dot gnu.org
  2022-05-27  8:02 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-12 11:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61761

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.3                         |9.4

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 9.3.0 has been released, adjusting target milestone.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/61761] [C++11] std::proj returns incorrect values
       [not found] <bug-61761-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-03-12 11:58 ` jakub at gcc dot gnu.org
@ 2021-06-01  8:06 ` rguenth at gcc dot gnu.org
  2022-05-27  8:02 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61761

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/61761] [C++11] std::proj returns incorrect values
       [not found] <bug-61761-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-06-01  8:06 ` rguenth at gcc dot gnu.org
@ 2022-05-27  8:02 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  8:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61761

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |---

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-27  8:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-61761-4@http.gcc.gnu.org/bugzilla/>
2015-04-09 15:41 ` [Bug libstdc++/61761] [C++11] std::proj returns incorrect values redi at gcc dot gnu.org
2020-03-10 15:39 ` redi at gcc dot gnu.org
2020-03-12 11:58 ` jakub at gcc dot gnu.org
2021-06-01  8:06 ` rguenth at gcc dot gnu.org
2022-05-27  8:02 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).