This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: round-off error in std::pow(std::complex<T>, double) in C++11


On Fri, Jan 25, 2013 at 9:15 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> On 01/25/2013 03:03 PM, Jordi Gutiérrez Hermoso wrote:
>>
>> error here, that this can reasonably be considered a bug in libstdc++.
>
> I don't have a strong opinion about this issue - whatever Gaby and Marc
> agree to do is fine with me - but I disagree that this is a plain libstdc++
> bug, because: 1- We are following the letter of the Standard in terms of
> overloads (adding back the C++03 (..., int) overload has implications which
> go beyond performance and accuracy, eg, the return type for (float, int)
> becomes float instead of double, and that can be easily detected); 2- We are
> otherwise simply forwarding to the front-end builtins / underlying libc.
>
> In my opinion - but, as I said already, I'm certainly not going to insist -
> real progress while remaining conforming would be either adding a more
> sophisticated set of overloads, in particular preserving the return type and
> in any case conforming or alternately improving the front-end code handling
> the builtins or the underlying libc; or maybe even re-open the ISO issue
> which led to the removal of the overload in the first place.
>
> Paolo.

Let me clarify my earlier statement.

I do think the change in the C++ spec from 03 to 11 is a bug.

I do believe that libstdc++ can do something to aleviate the
pain.  Doing that would be a QoI and since we were doing
better before the standard change, I believe we should find
a way to retain the previous superior behaviour.
That may be an additional overload with constraint that the
exponent argument be and integer -- with appropriate
enable_if incantation.

Yes, I agree it may be helpful to also request LWG to reopen
the issue.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]