</pre></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDCA");</script><h4class="subHeading">Parameters</h4><dl><dt><spanclass="parameter">str</span></dt><dd>Type:<ahref="06249483-9daf-95f9-32c7-30195550bbcc.htm">Math.Gmp.Native<spanid="LST793D64A7_1"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>char_ptr</a><br/></dd><dt><spanclass="parameter">expptr</span></dt><dd>Type:<ahref="542faa00-d28a-72a2-2dd8-6c6021e683ce.htm">Math.Gmp.Native<spanid="LST793D64A7_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>ptr</a><spanid="LST793D64A7_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_3?cs=<|vb=(Of |cpp=<|fs=<'|nu=(");</script><ahref="e6a17880-791f-37d4-4942-cf26ce7d4cbf.htm">mp_exp_t</a><spanid="LST793D64A7_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_4?cs=>|vb=)|cpp=>|fs=>|nu=)");</script><br/></dd><dt><spanclass="parameter">base</span></dt><dd>Type:<ahref="http://msdn2.microsoft.com/en-us/library/td2s409d"target="_blank">System<spanid="LST793D64A7_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Int32</a><br/></dd><dt><spanclass="parameter">n_digits</span></dt><dd>Type:<ahref="d9761bfb-1882-59d2-e89b-c6460141f9a6.htm">Math.Gmp.Native<spanid="LST793D64A7_6"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_6?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>size_t</a><br/></dd><dt><spanclass="parameter">op</span></dt><dd>Type:<ahref="37c88d6c-8d02-2330-ad77-f20fb73d1677.htm">Math.Gmp.Native<spanid="LST793D64A7_7"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_7?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_t</a><br/></dd></dl><h4class="subHeading">Return Value</h4>Type:<ahref="06249483-9daf-95f9-32c7-30195550bbcc.htm">char_ptr</a><br/>A pointer to the result string is returned, being either the allocated block or the given <spanclass="parameter">str</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>
The <spanclass="parameter">base</span> argument may vary from <spanclass="code">2</span> to <spanclass="code">62</span> or from <spanclass="code">-2</span> to <spanclass="code">-36</span>.
Up to <spanclass="parameter">n_digits</span> digits will be generated.
Trailing zeros are not returned.
No more digits than can be accurately represented by <spanclass="parameter">op</span> are ever generated.
If <spanclass="parameter">n_digits</span> is <spanclass="code">0</span> then that accurate maximum number of digits are generated.
</p><p>
For <spanclass="parameter">base</span> in the range <spanclass="code">2..36</span>, digits and lower-case letters are used; for <spanclass="code">-2..-36</span>,
digits and upper-case letters are used; for <spanclass="code">37..62</span>, digits, upper-case letters, and lower-case letters
(in that significance order) are used.
</p><p>
If <spanclass="parameter">str</span> is NULL, the result string is allocated using the current allocation function
(see <ahref="https://gmplib.org/manual/Custom-Allocation.html#Custom-Allocation">GNU MP - Custom Allocation</a>).
The block will be <spanclass="code">strlen(str) + 1</span> bytes, that being exactly enough for the string and null-terminator.
</p><p>
If <spanclass="parameter">str</span> is not NULL, it should point to a block of <spanclass="code"><spanclass="parameter">n_digits</span> + 2</span> bytes,
that being enough for the mantissa, a possible minus sign, and a null-terminator.
When <spanclass="parameter">n_digits</span> is <spanclass="code">0</span> to get all significant digits, an application won’t be able to know
the space required, and <spanclass="parameter">str</span> should be NULL in that case.
</p><p>
The generated string is a fraction, with an implicit radix point immediately to the left of the first digit.
The applicable exponent is written through the <spanclass="parameter">expptr</span> pointer.
For example, the number <spanclass="code">3.1416</span> would be returned as string <spanclass="code">"31416"</span> and exponent <spanclass="code">1</span>.
</p><p>
When <spanclass="parameter">op</span> is zero, an empty string is produced and the exponent returned is <spanclass="code">0</span>.
</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.</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">' Release unmanaged memory allocated for x.</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="648fa405-45d3-506a-f6be-72642e8a7f32.htm">gmp_lib<spanid="LST793D64A7_8"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_8?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_get_d(mpf_t)</a></div><divclass="seeAlsoStyle"><ahref="e1edc21e-74a0-b44c-216b-bad204b5a48a.htm">gmp_lib<spanid="LST793D64A7_9"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_9?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_get_d_2exp(ptr<spanid="LST793D64A7_10"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_10?cs=<|vb=(Of |cpp=<|fs=<'|nu=(");</script>Int32<spanid="LST793D64A7_11"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_11?cs=>|vb=)|cpp=>|fs=>|nu=)");</script>, mpf_t)</a></div><divclass="seeAlsoStyle"><ahref="d948e832-ee71-628a-6a7b-766138afff62.htm">gmp_lib<spanid="LST793D64A7_12"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_12?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_get_si(mpf_t)</a></div><divclass="seeAlsoStyle"><ahref="aa3fd0ea-a8b6-674b-59ff-b6d4785baed1.htm">gmp_lib<spanid="LST793D64A7_13"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST793D64A7_13?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_get_ui(mpf_t)</a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="https://gmplib.org/manual/Converting-Floats.html#Converting-Floats">GNU MP - Converting Floats</a></a></div></div></div></div><divid="pageFooter"class="pageFooter"></div></body></html>