public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/59421] New: stof(), stod() wrong result
@ 2013-12-07 23:45 stefan.helmert@t-online.de
  2013-12-08  0:58 ` [Bug libstdc++/59421] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: stefan.helmert@t-online.de @ 2013-12-07 23:45 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/59421] stof(), stod() wrong result
  2013-12-07 23:45 [Bug libstdc++/59421] New: stof(), stod() wrong result stefan.helmert@t-online.de
@ 2013-12-08  0:58 ` pinskia at gcc dot gnu.org
  2013-12-08  0:59 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-12-08  0:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59421

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2013-12-08
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Do you have a full testcase that is able to compile and work?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/59421] stof(), stod() wrong result
  2013-12-07 23:45 [Bug libstdc++/59421] New: stof(), stod() wrong result stefan.helmert@t-online.de
  2013-12-08  0:58 ` [Bug libstdc++/59421] " pinskia at gcc dot gnu.org
@ 2013-12-08  0:59 ` pinskia at gcc dot gnu.org
  2013-12-09 21:37 ` stefan.helmert@t-online.de
  2013-12-10 23:52 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-12-08  0:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59421

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Do you have a full testcase that is able to compile and work?

s/work/run/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/59421] stof(), stod() wrong result
  2013-12-07 23:45 [Bug libstdc++/59421] New: stof(), stod() wrong result stefan.helmert@t-online.de
  2013-12-08  0:58 ` [Bug libstdc++/59421] " pinskia at gcc dot gnu.org
  2013-12-08  0:59 ` pinskia at gcc dot gnu.org
@ 2013-12-09 21:37 ` stefan.helmert@t-online.de
  2013-12-10 23:52 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: stefan.helmert@t-online.de @ 2013-12-09 21:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59421

--- Comment #3 from Stefan Helmert <stefan.helmert@t-online.de> ---
OK, please try this code:
https://github.com/TheTesla/DigiKeyCSV2KiCadSCHpatcher/tree/gcctest

The relevant function is norm_value().


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/59421] stof(), stod() wrong result
  2013-12-07 23:45 [Bug libstdc++/59421] New: stof(), stod() wrong result stefan.helmert@t-online.de
                   ` (2 preceding siblings ...)
  2013-12-09 21:37 ` stefan.helmert@t-online.de
@ 2013-12-10 23:52 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2013-12-10 23:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59421

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Is all that code really necessary to demonstrate the bug?

Please read http://gcc.gnu.org/bugs/ again (you did read it before submitting
,as requested, right?)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-10 23:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-07 23:45 [Bug libstdc++/59421] New: stof(), stod() wrong result stefan.helmert@t-online.de
2013-12-08  0:58 ` [Bug libstdc++/59421] " pinskia at gcc dot gnu.org
2013-12-08  0:59 ` pinskia at gcc dot gnu.org
2013-12-09 21:37 ` stefan.helmert@t-online.de
2013-12-10 23:52 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).