summaryrefslogtreecommitdiff
path: root/stdlib/strtod_l.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-08-04 20:51:44 +0000
committerJakub Jelinek <jakub@redhat.com>2007-08-04 20:51:44 +0000
commit9452e30a05dd79850be35ba9886992f482761b1e (patch)
tree386776084a3fc4a14b2d560865dde715431d5e88 /stdlib/strtod_l.c
parente08057b1ff24258dd7460ad81e84491f7a28b424 (diff)
Updated to fedora-glibc-20070804T2027
Diffstat (limited to 'stdlib/strtod_l.c')
-rw-r--r--stdlib/strtod_l.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 4033e3bef8..939440f364 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -700,7 +700,8 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
#endif
/* If TP is at the start of the digits, there was no correctly
grouped prefix of the string; so no number found. */
- RETURN (0.0, tp == start_of_digits ? (base == 16 ? cp - 1 : nptr) : tp);
+ RETURN (negative ? -0.0 : 0.0,
+ tp == start_of_digits ? (base == 16 ? cp - 1 : nptr) : tp);
}
/* Remember first significant digit and read following characters until the
@@ -759,7 +760,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
if (tp < startp)
/* The number is validly grouped, but consists
only of zeroes. The whole value is zero. */
- RETURN (0.0, tp);
+ RETURN (negative ? -0.0 : 0.0, tp);
/* Recompute DIG_NO so we won't read more digits than
are properly grouped. */
@@ -862,7 +863,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
{
/* Overflow or underflow. */
__set_errno (ERANGE);
- result = (exp_negative ? 0.0 :
+ result = (exp_negative ? (negative ? -0.0 : 0.0) :
negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL);
}