On Wed, Sep 06, 2006 at 11:20:12PM +0200, Martijn van Oosterhout wrote: > Odd, according to these references: > > http://www.csse.uwa.edu.au/programming/ansic-library.html#stdlib > http://cplus.kompf.de/cliblist.html > http://docs.hp.com/en/B9106-90010/strtod.3C.html > > returning ERANGE on underflow was in the ANSI C standard. > > Can't find the text itself though,
In Plauger's _The Standard C Library_ (1992) on p 335 is an excerpt from the standard (I think). At the end of a section entitled "7.10.1.4 The strtod function" is the following: "If the correct value would cause underflow, zero is returned and the value of the macro ERANGE is stored in errno." I don't know how much weight a reference that old still has, but it does show that ERANGE on underflow has been defined for a long time. The Open Group Base Specifications Issue 6 (2004) also documents ERANGE on underflow: "If the correct value would cause an underflow, a value whose magnitude is no greater than the smallest normalized positive number in the return type shall be returned and errno set to [ERANGE]." I'd post the link but they want people to register to read the specification; you can get there from here: http://www.opengroup.org/online-pubs-short?DOC=9699959299&FORM=HTML -- Michael Fuhr ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend