• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/toolchains/hndtools-armeabi-2013.11/share/doc/arm-arm-none-eabi/html/libc/
1<html lang="en">
2<head>
3<title>wcstod - Untitled</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="Untitled">
6<meta name="generator" content="makeinfo 4.13">
7<link title="Top" rel="start" href="index.html#Top">
8<link rel="up" href="Stdlib.html#Stdlib" title="Stdlib">
9<link rel="prev" href="wcsrtombs.html#wcsrtombs" title="wcsrtombs">
10<link rel="next" href="wcstol.html#wcstol" title="wcstol">
11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
12<meta http-equiv="Content-Style-Type" content="text/css">
13<style type="text/css"><!--
14  pre.display { font-family:inherit }
15  pre.format  { font-family:inherit }
16  pre.smalldisplay { font-family:inherit; font-size:smaller }
17  pre.smallformat  { font-family:inherit; font-size:smaller }
18  pre.smallexample { font-size:smaller }
19  pre.smalllisp    { font-size:smaller }
20  span.sc    { font-variant:small-caps }
21  span.roman { font-family:serif; font-weight:normal; } 
22  span.sansserif { font-family:sans-serif; font-weight:normal; } 
23--></style>
24<link rel="stylesheet" type="text/css" href="../cs.css">
25</head>
26<body>
27<div class="node">
28<a name="wcstod"></a>
29<p>
30Next:&nbsp;<a rel="next" accesskey="n" href="wcstol.html#wcstol">wcstol</a>,
31Previous:&nbsp;<a rel="previous" accesskey="p" href="wcsrtombs.html#wcsrtombs">wcsrtombs</a>,
32Up:&nbsp;<a rel="up" accesskey="u" href="Stdlib.html#Stdlib">Stdlib</a>
33<hr>
34</div>
35
36<h3 class="section">2.40 <code>wcstod</code>, <code>wcstof</code>&mdash;wide char string to double or float</h3>
37
38<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>
39<pre class="example">     #include &lt;stdlib.h&gt;
40     double wcstod(const wchar_t *<var>str</var>, wchar_t **<var>tail</var>);
41     float wcstof(const wchar_t *<var>str</var>, wchar_t **<var>tail</var>);
42     
43     double _wcstod_r(void *<var>reent</var>,
44         const wchar_t *<var>str</var>, wchar_t **<var>tail</var>);
45     float _wcstof_r(void *<var>reent</var>,
46         const wchar_t *<var>str</var>, wchar_t **<var>tail</var>);
47     
48</pre>
49   <p><strong>Description</strong><br>
50The function <code>wcstod</code> parses the wide character string <var>str</var>,
51producing a substring which can be converted to a double
52value.  The substring converted is the longest initial
53subsequence of <var>str</var>, beginning with the first
54non-whitespace character, that has one of these formats:
55<pre class="smallexample">     [+|-]<var>digits</var>[.[<var>digits</var>]][(e|E)[+|-]<var>digits</var>]
56     [+|-].<var>digits</var>[(e|E)[+|-]<var>digits</var>]
57     [+|-](i|I)(n|N)(f|F)[(i|I)(n|N)(i|I)(t|T)(y|Y)]
58     [+|-](n|N)(a|A)(n|N)[&lt;(&gt;[<var>hexdigits</var>]&lt;)&gt;]
59     [+|-]0(x|X)<var>hexdigits</var>[.[<var>hexdigits</var>]][(p|P)[+|-]<var>digits</var>]
60     [+|-]0(x|X).<var>hexdigits</var>[(p|P)[+|-]<var>digits</var>]
61</pre>
62   <p>The substring contains no characters if <var>str</var> is empty, consists
63entirely of whitespace, or if the first non-whitespace
64character is something other than <code>+</code>, <code>-</code>, <code>.</code>, or a
65digit, and cannot be parsed as infinity or NaN. If the platform
66does not support NaN, then NaN is treated as an empty substring. 
67If the substring is empty, no conversion is done, and
68the value of <var>str</var> is stored in <code>*</code><var>tail</var>.  Otherwise,
69the substring is converted, and a pointer to the final string
70(which will contain at least the terminating null character of
71<var>str</var>) is stored in <code>*</code><var>tail</var>.  If you want no
72assignment to <code>*</code><var>tail</var>, pass a null pointer as <var>tail</var>. 
73<code>wcstof</code> is identical to <code>wcstod</code> except for its return type.
74
75   <p>This implementation returns the nearest machine number to the
76input decimal string.  Ties are broken by using the IEEE
77round-even rule.  However, <code>wcstof</code> is currently subject to
78double rounding errors.
79
80   <p>The alternate functions <code>_wcstod_r</code> and <code>_wcstof_r</code> are
81reentrant versions of <code>wcstod</code> and <code>wcstof</code>, respectively. 
82The extra argument <var>reent</var> is a pointer to a reentrancy structure.
83
84   <p><br>
85<strong>Returns</strong><br>
86Return the converted substring value, if any.  If
87no conversion could be performed, 0 is returned.  If the
88correct value is out of the range of representable values,
89plus or minus <code>HUGE_VAL</code> is returned, and <code>ERANGE</code> is
90stored in errno. If the correct value would cause underflow, 0
91is returned and <code>ERANGE</code> is stored in errno.
92
93   <p>Supporting OS subroutines required: <code>close</code>, <code>fstat</code>, <code>isatty</code>,
94<code>lseek</code>, <code>read</code>, <code>sbrk</code>, <code>write</code>.
95
96   <p><br>
97
98   </body></html>
99
100