[Bug libstdc++/59421] New: stof(), stod() wrong result
stefan.helmert@t-online.de
gcc-bugzilla@gcc.gnu.org
Sat Dec 7 23:45:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59421
Bug ID: 59421
Summary: stof(), stod() wrong result
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: stefan.helmert@t-online.de
sometimes:
y = stod(str); // with str = "0"
cout << y << endl;
prints out:
0.4167
It depends on where the executable is copied to. It does not depend on
optimisation level. I use c++11.
workaround:
y = stod(""+str+"");
Windows 7 64 bit, mingw-builds/x64-4.8.1-posix-seh-rev5
More information about the Gcc-bugs
mailing list