[Bug libstdc++/48760] New: std::complex constructor buggy in the face of NaN's
john at johnmaddock dot co.uk
gcc-bugzilla@gcc.gnu.org
Mon Apr 25 11:19:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48760
Summary: std::complex constructor buggy in the face of NaN's
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: blocker
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: john@johnmaddock.co.uk
If a std::complex<T> is constructed where one argument is finite and one a NaN
then the result is a complex number with both parts NaN, which is in violation
of 26.4.4 in the C++2011 std.
For example:
std::complex<float> c(0, std::numeric::limits<float>::quiet_NaN());
results in both real and imaginary parts of c being a NaN.
This causes failures in the Boost.Math regression tests, see also section
G.6.1.1 in C99 where such values can have well defined results for complex-trig
operations.
More information about the Gcc-bugs
mailing list