Error in std::pow(double, complex) - by scottim

Status : 

 


1
0
Sign in
to vote
ID 768415 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 10/23/2012 9:48:40 AM
Access Restriction Public

Description

This bug has been in the last few versions of MSVC++ .
It regards the implementation in the STL of the mathematical power functions for complex numbers.

Trying to find the sqrt of -1, which should give 0+i, two of three complex overloaded versions of std::pow() give roughly the right result, but one erroneously gives NaN.

Debugging into the STL it seems that the implementation of 
pow(double, complex) just uses the real version of pow if the exponent is real. That is only safe if the base argument is also non-negative, but this condition is not checked.
Sign in to post a comment.
Posted by scottim on 12/4/2014 at 10:00 AM
Thank-you for fixing. Works for me in VC12.
Posted by Deon [MSFT] on 4/29/2014 at 12:31 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from: http://go.microsoft.com/?linkid=9832436
Posted by Stephan [MSFT] on 5/6/2013 at 1:55 PM
Hi again,

We've fixed this bug, and the fix will be available in VC12.

Reminder: Connect doesn't notify me about comments. If you have any further questions, please E-mail me.

Stephan T. Lavavej
Senior Developer - Visual C++ Libraries
stl@microsoft.com
Posted by Stephan [MSFT] on 3/26/2013 at 12:35 AM
Hi,

Thanks for reporting this bug. I wanted to let you know what's happening with it. I'm still keeping track of it, but it's been resolved as "Deferred" because we may not have time to fix it in VC12. (Note: VC8 = VS 2005, VC9 = VS 2008, VC10 = VS 2010, VC11 = VS 2012.)

Note: Connect doesn't notify me about comments. If you have any further questions, please E-mail me.

Stephan T. Lavavej
Senior Developer - Visual C++ Libraries
stl@microsoft.com
Posted by Macy [MSFT] on 10/23/2012 at 11:43 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Macy [MSFT] on 10/23/2012 at 9:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)