In VS2005 C++, Zero reported as negative zero for double type - by Global Lens

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


0
0
Sign in
to vote
ID 292276 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 8/9/2007 2:52:15 PM
Access Restriction Public

Description

In VS2005 C++, if double type zero times negative one, the result will become negative zero.  But in VS2003, the result is expected as zero.  And then if integer type zero times negative one, the result will become zero which we expected.  

Sign in to post a comment.
Posted by Ale [MSFT] on 8/15/2007 at 10:44 AM
Hi,

Actually, the correct result is -0.0 and VS 2005 gets is right. VS 2003 had a bug. For integer types there is no -0.

You should consult the floating-point documentation on special values: -0.0, Inf, NaN.

HTH,

Ale Contenti
VC++ Libraries Dev Lead
Posted by Microsoft on 8/9/2007 at 7:46 PM
Thanks for your feedback. We have reproduced this bug on WinXP SP2 and OrcasBeta2VSTS, and we are sending this bug to the appropriate group within the Visual Studio Product Team for triage and resolution. Thank you, Visual Studio Product Team.
Posted by Microsoft on 8/9/2007 at 7:34 PM
Thank you for your feedback. We are currently investigating. If this issue is urgent, please call support directly (see http://support.microsoft.com). Thank you, Visual Studio Product Team.