[Bug libstdc++/28406] What should be value of sqrt(complexdouble(-1.0,-0.0))?
--- Comment #9 from paolo dot carlini at oracle dot com 2009-05-08 11:38 --- Really, this can be closed, all the recent branches are fine. I also double checked that another couple of implementations give the same result. -- paolo dot carlini at oracle dot com changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||WORKSFORME http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28406
[Bug libstdc++/28406] What should be value of sqrt(complexdouble(-1.0,-0.0))?
--- Comment #4 from pcarlini at suse dot de 2006-08-07 10:04 --- I'm looking at C99, G.6/3 and it looks like the builtin (as implemented by glibc) is correct, or at least C99 complex conforming: the expected result is (0, -1). indeed, this is also stated at the end of the mentioned C99 7.3.3/1. Frankly, I don't think there is much more to say. Gaby, can we close this? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28406
[Bug libstdc++/28406] What should be value of sqrt(complexdouble(-1.0,-0.0))?
--- Comment #5 from ian at airs dot com 2006-08-07 17:14 --- Insofar as I understand this issue, it seems that C99 and the C++ standard specify different results for the square root of (-1, -0). If that is correct, then we can decide that we want libstdc++ to follow C99 rather than the C++ standard, but I don't think we can settle that simply by looking at C99. -- ian at airs dot com changed: What|Removed |Added CC||ian at airs dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28406
[Bug libstdc++/28406] What should be value of sqrt(complexdouble(-1.0,-0.0))?
--- Comment #6 from pcarlini at suse dot de 2006-08-07 17:24 --- (In reply to comment #5) Insofar as I understand this issue, it seems that C99 and the C++ standard specify different results for the square root of (-1, -0). If that is correct, then we can decide that we want libstdc++ to follow C99 rather than the C++ standard, but I don't think we can settle that simply by looking at C99. Well, I see where the C++ standard says, in 26.2.8/13, ..., the value returned lies on the positive imaginary axis, however, let's admit that the current C++ standard is *very* sloppy about these mathematical subtleties: for one, the *entire* C++ standard has *no* notion of signed zero (at issue here!), neither of NaNs, or infinity, for that matter. Also, more generally, when we decided to use builtins everywhere, thus, eventually, libc functions, we made the choice that consistency with the C library is a must, I don't think we want to change that decision. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28406
[Bug libstdc++/28406] What should be value of sqrt(complexdouble(-1.0,-0.0))?
--- Comment #7 from pcarlini at suse dot de 2006-08-07 17:26 --- By the way, as I read the cited LIA-3 draft, it's also consisten with C99. To restate my point in a different way, if we believe there is an inconsistency between C99 and C++03, then the former can only win about this specific issue (and hopefully C++0x also). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28406
[Bug libstdc++/28406] What should be value of sqrt(complexdouble(-1.0,-0.0))?
--- Comment #8 from pcarlini at suse dot de 2006-08-07 18:16 --- (In reply to comment #7) By the way, as I read the cited LIA-3 draft, it's also consisten with C99. To restate my point in a different way, if we believe there is an inconsistency between C99 and C++03, then the former can only win about this specific issue (and hopefully C++0x also). But, actually, I don't think there are any inconsistencis here: the C++03 standard has no notion of -0.0 and, I maintain, the return value of sqrt(-1.0, -0.0) is undefined in C++03. Moreover, the value which we are currently (in GCC 4.x) returning, is consistent with C99 and LIA-3, and that seems a good QoI to me. Really, after all, I think everything is fine, for now at least (in principle C++0x may decide to be inconsistent with C99 and LIA-3 ;) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28406
[Bug libstdc++/28406] What should be value of sqrt(complexdouble(-1.0,-0.0))?
--- Comment #2 from pcarlini at suse dot de 2006-08-04 00:01 --- The difference between 3.4.x and 4.x is due to the builtins, therefore the underlying libc, being called by the latter. As such, this is not a libstdc++-v3 proper issue anymore, because in any case, we definitely want to use the builtins, when available... Gaby, can you have a look? -- pcarlini at suse dot de changed: What|Removed |Added CC||gdr at integrable-solutions ||dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28406
[Bug libstdc++/28406] What should be value of sqrt(complexdouble(-1.0,-0.0))?
--- Comment #3 from gdr at integrable-solutions dot net 2006-08-04 00:09 --- Subject: Re: What should be value of sqrt(complexdouble(-1.0,-0.0))? pcarlini at suse dot de [EMAIL PROTECTED] writes: | The difference between 3.4.x and 4.x is due to the builtins, therefore the | underlying libc, being called by the latter. As such, this is not a | libstdc++-v3 proper issue anymore, because in any case, we definitely want to | use the builtins, when available... Gaby, can you have a look? yes; thanks! -- Gaby -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28406
[Bug libstdc++/28406] What should be value of sqrt(complexdouble(-1.0,-0.0))?
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-07-17 11:43 --- It should be important to note that some versions of glibc has a broken csqrt, see PR 24313. Also see the following glibc bugs: http://sources.redhat.com/bugzilla/show_bug.cgi?id=2181 http://sources.redhat.com/bugzilla/show_bug.cgi?id=2182 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28406