</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="LST8C6B5A0E_1"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST8C6B5A0E_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="LST8C6B5A0E_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST8C6B5A0E_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>char_ptr</a><br/>The operand string.</dd><dt><spanclass="parameter">base</span></dt><dd>Type:<ahref="http://msdn2.microsoft.com/en-us/library/td2s409d"target="_blank">System<spanid="LST8C6B5A0E_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST8C6B5A0E_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 <spanclass="code">0</span> if the entire string is a valid number in base <spanclass="parameter">base</span>. Otherwise it returns <spanclass="code">-1</span>.</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>
See <ahref="823b356e-0731-c9ca-0b37-660b6eb9ee7c.htm">mpf_set_str(mpf_t, char_ptr, Int32)</a> for details on the assignment operation.
</p><p>
Note that <spanclass="parameter">rop</span> is initialized even if an error occurs. (I.e., you have to call <ahref="3a2a17ed-a64c-8716-7f65-18c661a5279f.htm">mpf_clear(mpf_t)</a> for it.)
</p><p>
The precision of <spanclass="parameter">rop</span> will be taken from the active default precision, as set by <ahref="9e93d02e-f5c7-1a6f-68fe-a33d793a93e2.htm">mpf_set_default_prec(mp_bitcnt_t)</a>.
</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">// Set default precision to 64 bits.</span>
<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">' Set default precision to 64 bits.</span>
<spanclass="highlight-comment">' Create, initialize, and set a new floating-point number x to 0.0234.</span>
<spanclass="highlight-keyword">Dim</span> value <spanclass="highlight-keyword">As</span><spanclass="highlight-keyword">New</span> char_ptr(<spanclass="highlight-literal">"234e-4"</span>)
<spanclass="highlight-keyword">Dim</span> x <spanclass="highlight-keyword">As</span><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(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="17b3dc26-68af-fb0c-9923-36777e8bd87e.htm">gmp_lib<spanid="LST8C6B5A0E_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST8C6B5A0E_4?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_init_set(mpf_t, mpf_t)</a></div><divclass="seeAlsoStyle"><ahref="8d1b97c9-ef9d-303a-0fbe-e7ece7edf391.htm">gmp_lib<spanid="LST8C6B5A0E_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST8C6B5A0E_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_init_set_ui(mpf_t, UInt32)</a></div><divclass="seeAlsoStyle"><ahref="dc1406fd-4ca4-70d3-dc83-bd40b955564a.htm">gmp_lib<spanid="LST8C6B5A0E_6"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST8C6B5A0E_6?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_init_set_si(mpf_t, Int32)</a></div><divclass="seeAlsoStyle"><ahref="a2c14761-1b23-0de9-3842-c2d4e3d7aac0.htm">gmp_lib<spanid="LST8C6B5A0E_7"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST8C6B5A0E_7?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_init_set_d(mpf_t, Double)</a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="https://gmplib.org/manual/Simultaneous-Float-Init-_0026-Assign.html#Simultaneous-Float-Init-_0026-Assign">GNU MP - Combined Float Initialization and Assignment</a></a></div></div></div></div><divid="pageFooter"class="pageFooter"></div></body></html>