public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/89991] Complex numbers: Calculation of imaginary part is not correct
       [not found] <bug-89991-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-07 16:53 ` kargl at gcc dot gnu.org
  2020-03-10 15:30 ` redi at gcc dot gnu.org
  2020-03-10 16:07 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-03-07 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
           Priority|P3                          |P2
           Severity|normal                      |major

--- Comment #26 from kargl at gcc dot gnu.org ---
Any chance a libstdc++ person will commit the supplied patches?

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

* [Bug libstdc++/89991] Complex numbers: Calculation of imaginary part is not correct
       [not found] <bug-89991-4@http.gcc.gnu.org/bugzilla/>
  2020-03-07 16:53 ` [Bug libstdc++/89991] Complex numbers: Calculation of imaginary part is not correct kargl at gcc dot gnu.org
@ 2020-03-10 15:30 ` redi at gcc dot gnu.org
  2020-03-10 16:07 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2020-03-10 15:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #27 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Not in stage 4.

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

* [Bug libstdc++/89991] Complex numbers: Calculation of imaginary part is not correct
       [not found] <bug-89991-4@http.gcc.gnu.org/bugzilla/>
  2020-03-07 16:53 ` [Bug libstdc++/89991] Complex numbers: Calculation of imaginary part is not correct kargl at gcc dot gnu.org
  2020-03-10 15:30 ` redi at gcc dot gnu.org
@ 2020-03-10 16:07 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2020-03-10 16:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #28 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to kargl from comment #21)
> Created attachment 46102 [details]
> fix g++ problem with sqrt(z) where z is complex and imag(z) = -0

This one assumes copysign is valid for arguments of type _Tp, which is only
true for float, double and long double. std::pow might make sense for complex
integers, but seems to be already broken, so this doesn't make it any worse
there.

To preserve support for user-defined numeric types (and decimal floats?) we
could add an overloaded helper for copysign which retains the `__x < _Tp()`
check for the generic overload and uses copysign for floating point types.


(In reply to kargl from comment #23)
> Created attachment 46105 [details]
> fix g++ problem with pow(z,0.5) where imag(z) = -0.
> 
> This patch has only been tested with the original test provided by the
> reporter.

This one makes me a little uncomfortable with the use of abs, but we already
use that elsewhere (and inconsistently qualify it as std::abs). Again, this
doesn't seem to make anything worse w.r.t our support for types other than
float, double and long double.

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

end of thread, other threads:[~2020-03-10 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-89991-4@http.gcc.gnu.org/bugzilla/>
2020-03-07 16:53 ` [Bug libstdc++/89991] Complex numbers: Calculation of imaginary part is not correct kargl at gcc dot gnu.org
2020-03-10 15:30 ` redi at gcc dot gnu.org
2020-03-10 16:07 ` redi 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).