Red Hat Bugzilla – Bug 462081
[RHEL4] Incorrect behaviour of atof() and strtod()
Last modified: 2009-05-18 16:34:19 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):
Sample program to reproduce the bug is attached.
gcc broken.c -o broken -lm
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.
Created attachment 316582 [details]
Sample program to expose the bug by parsing the string "-0" using strtod() and atof()
This was fixed by glibc-strtod--0.patch in RHEL5 glibc-2.5-20 and above.
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.