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: unassig...@gcc.gnu.org
        ReportedBy: j...@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.

Reply via email to