http://bugs.winehq.org/show_bug.cgi?id=33254
Bug #: 33254 Summary: sprintf doesn't respect _set_output_format for E format Product: Wine Version: 1.5.26 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: sebastian.wolff@dynardo.at Classification: Unclassified
On UNIX systems the printf functions always create an exponent with 2 digits. This is different on Windows, where 3 digits are used for the exponent at least by default. One can, however, justify this default:
#include <stdio.h> #include <iostream>
int main() {
// enforce 2 digits in the exponent of printf() floating point format (Windows uses 3 digits by default, UNIX uses 2) unsigned int old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
char string[80]; int node_id(0); double x(0),y(0),z(0), node_info_1(0), node_info_2(0); int num_written = sprintf(string, "%8d%16.8E%16.8E%16.8E%8d%8d", node_id, x, y, z, node_info_1, node_info_2);
std::cout << string << std::endl;
// restore number of digits in printf floating point format _set_output_format(old_exponent_format); }
On Windows this produces output with 2 digits used for the exponent. On WINE, however, always 3 digits are used.
http://bugs.winehq.org/show_bug.cgi?id=33254
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban@gmail.com AssignedTo|wine-bugs@winehq.org |piotr@codeweavers.com
http://bugs.winehq.org/show_bug.cgi?id=33254
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |9c4be83a78c5a105d4e3305d997 | |7c213a4503a84 Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #1 from Piotr Caban piotr.caban@gmail.com 2013-03-27 16:00:24 CDT --- _set_output_format function is now implemented. Marking as fixed.
http://bugs.winehq.org/show_bug.cgi?id=33254
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #2 from Alexandre Julliard julliard@winehq.org 2013-03-29 13:33:07 CDT --- Closing bugs fixed in 1.5.27.
http://bugs.winehq.org/show_bug.cgi?id=33254
--- Comment #3 from Sebastian sebastian.wolff@dynardo.at 2013-04-05 06:35:20 CDT --- Thanks for fixing this!