octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Paolo Carlini
Subject: Re: round-off error in std::pow(std::complex<T>, double) in C++11
Date: Fri, 25 Jan 2013 17:18:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

On 01/25/2013 04:44 PM, Paolo Carlini wrote:
.. oops, I just noticed what Marc suggested in the PR about changing pow(const complex<>&, const _Tp&) to *actually* forward to the complex builtins when not fast math. That seems a good idea
I have to add to this, however, that unless I did something badly wrong in a quick prototype, simply forwarding to the (complex, complex) builtin would *not* fix the round-off issue for this specific example. In other terms it seems that to actually get 0 we really have to handle separately (small) integer exponents, as Marc mentioned in the PR. Then again, is this overall a libstdc++ issue or it would make sense to have the (..., int) overloads restored at the *ISO* level?

Paolo.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]