[MSVC 7.1] printf("%#.2g", 0.0) incorrect output ------------------------------------------------
Key: STDCXX-496 URL: https://issues.apache.org/jira/browse/STDCXX-496 Project: C++ Standard Library Issue Type: Bug Components: External Reporter: Martin Sebor Moved from Rogue Wave Bugzilla: http://bugzilla.cvo.roguewave.com/show_bug.cgi?id=1549 $ cat t.cpp && cl t.cpp && ./t.exe #include <assert.h> #include <stdio.h> #include <string.h> int main () { char s [8]; sprintf (s, "%#.2g", 0.0); assert (0 == strcmp ("0.0", s)); } Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86 Copyright (C) Microsoft Corporation 1984-2002. All rights reserved. t.cpp Microsoft (R) Incremental Linker Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. /out:t.exe t.obj Assertion failed: 0 == strcmp ("0.0", s), file t.cpp, line 10 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.