(I suspect this patch is incomplete, but it covers all of the test cases I've got. Help identifying additional places where this bug might exist would be greatly appreciated) The C standard says that errno may acquire the value ERANGE if the result from strtod underflows. According to IEEE 754, underflow occurs whenever the value cannot be represented in normalized form. Newlib is inconsistent in this, setting errno to ERANGE only if the value underflows to zero, but not for denorm values, and never for hex format floats. This patch attempts to consistently set errno to ERANGE for all 'underflow' conditions, which is to say all values which are not exactly zero and which cannot be represented in normalized form. This matches glibc behavior, as well as the Linux, Mac OS X, OpenBSD, FreeBSD and SunOS strtod man pages.