| <html lang="en"> |
| <head> |
| <title>wcstod - Untitled</title> |
| <meta http-equiv="Content-Type" content="text/html"> |
| <meta name="description" content="Untitled"> |
| <meta name="generator" content="makeinfo 4.13"> |
| <link title="Top" rel="start" href="index.html#Top"> |
| <link rel="up" href="Stdlib.html#Stdlib" title="Stdlib"> |
| <link rel="prev" href="wcsrtombs.html#wcsrtombs" title="wcsrtombs"> |
| <link rel="next" href="wcstol.html#wcstol" title="wcstol"> |
| <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <style type="text/css"><!-- |
| pre.display { font-family:inherit } |
| pre.format { font-family:inherit } |
| pre.smalldisplay { font-family:inherit; font-size:smaller } |
| pre.smallformat { font-family:inherit; font-size:smaller } |
| pre.smallexample { font-size:smaller } |
| pre.smalllisp { font-size:smaller } |
| span.sc { font-variant:small-caps } |
| span.roman { font-family:serif; font-weight:normal; } |
| span.sansserif { font-family:sans-serif; font-weight:normal; } |
| --></style> |
| </head> |
| <body> |
| <div class="node"> |
| <a name="wcstod"></a> |
| <p> |
| Next: <a rel="next" accesskey="n" href="wcstol.html#wcstol">wcstol</a>, |
| Previous: <a rel="previous" accesskey="p" href="wcsrtombs.html#wcsrtombs">wcsrtombs</a>, |
| Up: <a rel="up" accesskey="u" href="Stdlib.html#Stdlib">Stdlib</a> |
| <hr> |
| </div> |
| |
| <h3 class="section">2.40 <code>wcstod</code>, <code>wcstof</code>—wide char string to double or float</h3> |
| |
| <p><a name="index-wcstod-94"></a><a name="index-g_t_005fwcstod_005fr-95"></a><a name="index-wcstof-96"></a><a name="index-g_t_005fwcstof_005fr-97"></a><strong>Synopsis</strong> |
| <pre class="example"> #include <stdlib.h> |
| double wcstod(const wchar_t *<var>str</var>, wchar_t **<var>tail</var>); |
| float wcstof(const wchar_t *<var>str</var>, wchar_t **<var>tail</var>); |
| |
| double _wcstod_r(void *<var>reent</var>, |
| const wchar_t *<var>str</var>, wchar_t **<var>tail</var>); |
| float _wcstof_r(void *<var>reent</var>, |
| const wchar_t *<var>str</var>, wchar_t **<var>tail</var>); |
| |
| </pre> |
| <p><strong>Description</strong><br> |
| The function <code>wcstod</code> parses the wide character string <var>str</var>, |
| producing a substring which can be converted to a double |
| value. The substring converted is the longest initial |
| subsequence of <var>str</var>, beginning with the first |
| non-whitespace character, that has one of these formats: |
| <pre class="smallexample"> [+|-]<var>digits</var>[.[<var>digits</var>]][(e|E)[+|-]<var>digits</var>] |
| [+|-].<var>digits</var>[(e|E)[+|-]<var>digits</var>] |
| [+|-](i|I)(n|N)(f|F)[(i|I)(n|N)(i|I)(t|T)(y|Y)] |
| [+|-](n|N)(a|A)(n|N)[<(>[<var>hexdigits</var>]<)>] |
| [+|-]0(x|X)<var>hexdigits</var>[.[<var>hexdigits</var>]][(p|P)[+|-]<var>digits</var>] |
| [+|-]0(x|X).<var>hexdigits</var>[(p|P)[+|-]<var>digits</var>] |
| </pre> |
| <p>The substring contains no characters if <var>str</var> is empty, consists |
| entirely of whitespace, or if the first non-whitespace |
| character is something other than <code>+</code>, <code>-</code>, <code>.</code>, or a |
| digit, and cannot be parsed as infinity or NaN. If the platform |
| does not support NaN, then NaN is treated as an empty substring. |
| If the substring is empty, no conversion is done, and |
| the value of <var>str</var> is stored in <code>*</code><var>tail</var>. Otherwise, |
| the substring is converted, and a pointer to the final string |
| (which will contain at least the terminating null character of |
| <var>str</var>) is stored in <code>*</code><var>tail</var>. If you want no |
| assignment to <code>*</code><var>tail</var>, pass a null pointer as <var>tail</var>. |
| <code>wcstof</code> is identical to <code>wcstod</code> except for its return type. |
| |
| <p>This implementation returns the nearest machine number to the |
| input decimal string. Ties are broken by using the IEEE |
| round-even rule. However, <code>wcstof</code> is currently subject to |
| double rounding errors. |
| |
| <p>The alternate functions <code>_wcstod_r</code> and <code>_wcstof_r</code> are |
| reentrant versions of <code>wcstod</code> and <code>wcstof</code>, respectively. |
| The extra argument <var>reent</var> is a pointer to a reentrancy structure. |
| |
| <p><br> |
| <strong>Returns</strong><br> |
| Return the converted substring value, if any. If |
| no conversion could be performed, 0 is returned. If the |
| correct value is out of the range of representable values, |
| plus or minus <code>HUGE_VAL</code> is returned, and <code>ERANGE</code> is |
| stored in errno. If the correct value would cause underflow, 0 |
| is returned and <code>ERANGE</code> is stored in errno. |
| |
| <p>Supporting OS subroutines required: <code>close</code>, <code>fstat</code>, <code>isatty</code>, |
| <code>lseek</code>, <code>read</code>, <code>sbrk</code>, <code>write</code>. |
| |
| <p><br> |
| |
| </body></html> |
| |