Hello Michael,

About Debian Bug #756599 [1], I found this explanation [2][3] confirming that * is not a selector :


strtod recognizes four special input strings. The strings "inf" and "infinity" are converted to ∞, or to the largest representable value if the floating-point format doesn’t support infinities. You can prepend a "+" or "-" to specify the sign. Case is ignored when scanning these strings.

The strings "nan" and "nan(chars…)" are converted to NaN. Again, case is ignored. If chars… are provided, they are used in some unspecified fashion to select a particular representation of NaN (there can be several).

Since zero is a valid result as well as the value returned on error, you should check for errors in the same way as for strtol, by examining errno and tailptr.


Regards,

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756599
[2] https://www.gnu.org/software/libc/manual/html_node/Parsing-of-Floats.html [3] http://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/Infinity-and-NaN.html

--
Stéphane Aulery

Reply via email to