Bug 462081 - [RHEL4] Incorrect behaviour of atof() and strtod()
[RHEL4] Incorrect behaviour of atof() and strtod()
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: rc
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2008-09-12 10:43 EDT by internal.systems
Modified: 2009-05-18 16:34 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-05-18 16:34:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Sample program to expose the bug by parsing the string "-0" using strtod() and atof() (390 bytes, text/plain)
2008-09-12 10:46 EDT, internal.systems
no flags Details

  None (edit)
Description internal.systems 2008-09-12 10:43:56 EDT
Description of problem:

Using the string "-0" on functions atof() and strtod() yields the floating point number 0.0 instead of -0.0.

Version-Release number of selected component (if applicable):


How reproducible:

Sample program to reproduce the bug is attached.

gcc broken.c -o broken -lm
Actual results:

sscanf -0.000000
strtod 0.000000
atof 0.000000
buf -0

Expected results:

sscanf -0.000000
strtod -0.000000
atof -0.000000
buf -0

Additional info:

Tried this on two up to date RHEL4 boxes, both exhibited the problem.
A RHEL3 box, and a very out of date RHEL4 box did not exhibit the problem.
Comment 1 internal.systems 2008-09-12 10:46:45 EDT
Created attachment 316582 [details]
Sample program to expose the bug by parsing the string "-0" using strtod() and atof()
Comment 3 Jakub Jelinek 2009-01-09 10:40:49 EST
This was fixed by glibc-strtod--0.patch in RHEL5 glibc-2.5-20 and above.
Comment 9 errata-xmlrpc 2009-05-18 16:34:19 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.