Bug 10404 - strtod of very small number returns with errno set to ERANGE
Summary: strtod of very small number returns with errno set to ERANGE
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.10
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-16 20:16 UTC by Orion Poplawski
Modified: 2014-07-01 07:47 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Orion Poplawski 2009-07-16 20:16:10 UTC
strtod (and atof) of "5.30498947741318e-315" returns 5.3049894774131808e-315 but
with errno set to ERANGE.  This is new in 2.10.1 compared to 2.9 and does not
appear to be correct.
Comment 1 Ulrich Drepper 2009-07-16 20:30:27 UTC
That's the correct behavior.
Comment 2 Orion Poplawski 2009-07-16 21:21:47 UTC
I guess it depends on what you think "cannot be represented, without
extraordinary roundoff error" (definition of underflow from the C99 standard
[7.12.1.5]) means.  5.3049894774131808e-315 compared to 5.30498947741318e-315
does not appear to me to have "extraordinary roundoff error".  I would suggest
that something other than a simple comparison with 2.2250738585072014E-308 for
triggering ERANGE is in order.