</pre></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDCA");</script><h4class="subHeading">Parameters</h4><dl><dt><spanclass="parameter">rop</span></dt><dd>Type:<ahref="37c88d6c-8d02-2330-ad77-f20fb73d1677.htm">Math.Gmp.Native<spanid="LST19DC7C0C_1"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST19DC7C0C_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_t</a><br/>The result float.</dd><dt><spanclass="parameter">str</span></dt><dd>Type:<ahref="06249483-9daf-95f9-32c7-30195550bbcc.htm">Math.Gmp.Native<spanid="LST19DC7C0C_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST19DC7C0C_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>char_ptr</a><br/>The input string.</dd><dt><spanclass="parameter">base</span></dt><dd>Type:<ahref="http://msdn2.microsoft.com/en-us/library/td2s409d"target="_blank">System<spanid="LST19DC7C0C_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST19DC7C0C_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Int32</a><br/>The base.</dd></dl><h4class="subHeading">Return Value</h4>Type:<ahref="http://msdn2.microsoft.com/en-us/library/td2s409d"target="_blank">Int32</a><br/>This function returns 0 if the entire string is a valid number in base <spanclass="parameter">base</span>. Otherwise it returns -1.</div><divclass="collapsibleAreaRegion"><spanclass="collapsibleRegionTitle"onclick="SectionExpandCollapse('ID2RB')"onkeypress="SectionExpandCollapse_CheckKey('ID2RB', event)"tabindex="0"><imgid="ID2RBToggle"class="collapseToggle"src="../icons/SectionExpanded.png"/>Remarks</span></div><divid="ID2RBSection"class="collapsibleSection"><p>
The string is of the form "M@N" or, if the <spanclass="parameter">base</span> is 10 or less,
Unlike the corresponding <spanclass="code">mpz</span> function, the <spanclass="parameter">base</span> will not be determined from the leading characters
White space is allowed in the string, and is simply ignored.
[This is not really true; white-space is ignored in the beginning of the string and within the mantissa,
but not in other places, such as after a minus sign or in the exponent.
We are considering changing the definition of this function, making it fail when there is any white-space
in the input, since that makes a lot of sense.
Please tell us your opinion about this change.
Do you really want it to accept "3 14" as meaning 314 as it does now?]
</p></div><divclass="collapsibleAreaRegion"><spanclass="collapsibleRegionTitle"onclick="SectionExpandCollapse('ID3RB')"onkeypress="SectionExpandCollapse_CheckKey('ID3RB', event)"tabindex="0"><imgid="ID3RBToggle"class="collapseToggle"src="../icons/SectionExpanded.png"/>Examples</span></div><divid="ID3RBSection"class="collapsibleSection"><divclass="codeSnippetContainer"><divclass="codeSnippetContainerTabs"><divid="ID0EDAABA_tab1"class="codeSnippetContainerTab"><ahref="#"onclick="javascript:ChangeTab('ID0EDAABA','cs','1','4');return false;">C#</a></div><divid="ID0EDAABA_tab2"class="codeSnippetContainerTab"><ahref="#"onclick="javascript:ChangeTab('ID0EDAABA','vb','2','4');return false;">VB</a></div><divid="ID0EDAABA_tab3"class="codeSnippetContainerTabPhantom"><ahref="#"onclick="javascript:ChangeTab('ID0EDAABA','cpp','3','4');return false;">C++</a></div><divid="ID0EDAABA_tab4"class="codeSnippetContainerTabPhantom"><ahref="#"onclick="javascript:ChangeTab('ID0EDAABA','fs','4','4');return false;">F#</a></div></div><divclass="codeSnippetContainerCodeContainer"><divclass="codeSnippetToolBar"><divclass="codeSnippetToolBarText"><aid="ID0EDAABA_copyCode"href="#"class="copyCodeSnippet"onclick="javascript:CopyToClipboard('ID0EDAABA');return false;"title="Copy">Copy</a></div></div><divid="ID0EDAABA_code_Div1"class="codeSnippetContainerCode"style="display: block"><prexml:space="preserve"><spanclass="highlight-comment">// Create, initialize, and set a new floating-point number x to 0.0234.</span>
mpf_t x = <spanclass="highlight-keyword">new</span> mpf_t();
<spanclass="highlight-comment">// Release unmanaged memory allocated for x and y.</span>
gmp_lib.mpf_clear(x);
gmp_lib.free(<spanclass="highlight-keyword">value</span>);</pre></div><divid="ID0EDAABA_code_Div2"class="codeSnippetContainerCode"style="display: none"><prexml:space="preserve"><spanclass="highlight-comment">' Create, initialize, and set a new floating-point number x to 0.0234.</span>
<spanclass="highlight-keyword">Dim</span> x <spanclass="highlight-keyword">As</span><spanclass="highlight-keyword">New</span> mpf_t()
gmp_lib.mpf_init(x)
<spanclass="highlight-keyword">Dim</span> value <spanclass="highlight-keyword">As</span><spanclass="highlight-keyword">New</span> char_ptr(<spanclass="highlight-literal">"234e-4"</span>)
gmp_lib.free(value)</pre></div><divid="ID0EDAABA_code_Div3"class="codeSnippetContainerCode"style="display: none"><p>No code example is currently available or this language may not be supported.</p></div><divid="ID0EDAABA_code_Div4"class="codeSnippetContainerCode"style="display: none"><p>No code example is currently available or this language may not be supported.</p></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDAABA");</script></div><divclass="collapsibleAreaRegion"id="seeAlsoSection"><spanclass="collapsibleRegionTitle"onclick="SectionExpandCollapse('ID4RB')"onkeypress="SectionExpandCollapse_CheckKey('ID4RB', event)"tabindex="0"><imgid="ID4RBToggle"class="collapseToggle"src="../icons/SectionExpanded.png"/>See Also</span></div><divid="ID4RBSection"class="collapsibleSection"><h4class="subHeading">Reference</h4><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm">gmp_lib Class</a></div><divclass="seeAlsoStyle"><ahref="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm">Math.Gmp.Native Namespace</a></div><divclass="seeAlsoStyle"><ahref="3a025035-e715-0a3d-8d2d-6011430c9463.htm">mpf_set</a></div><divclass="seeAlsoStyle"><ahref="060aa73e-8c00-0a6b-f569-ad198c4f0d90.htm">mpf_set_ui</a></div><divclass="seeAlsoStyle"><ahref="f059f8e4-dfc8-79fe-6455-42e227ccbc2e.htm">mpf_set_si</a></div><divclass="seeAlsoStyle"><ahref="1d0c5734-9f0d-ec6b-c540-4379f832b0ca.htm">mpf_set_d</a></div><divclass="seeAlsoStyle"><ahref="d60489f8-91f8-ea00-d29c-a52449e712da.htm">mpf_set_z</a></div><divclass="seeAlsoStyle"><ahref="bd669b1e-a941-2e35-7c29-29a5b5ff5e3a.htm">mpf_set_q</a></div><divclass="seeAlsoStyle"><ahref="b77c0292-518a-64d8-4b4e-0dd3c0cb801f.htm">mpf_swap</a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="/html/3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm#Assigning_Floats">Assigning Floats</a></a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="https://gmplib.org/manual/Assigning-Floats.html#Assigning-Floats">GNU MP - Assigning Floats</a></a></div></div></div></div><divid="pageFooter"class="pageFooter"></div></body></html>