</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="LSTC58F7F1B_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTC58F7F1B_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>char_ptr</a><br/>The output string.</dd><dt><spanclass="parameter">expptr</span></dt><dd>Type:<ahref="e6a17880-791f-37d4-4942-cf26ce7d4cbf.htm">Math.Gmp.Native<spanid="LSTC58F7F1B_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTC58F7F1B_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_exp_t</a><spanid="LSTC58F7F1B_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTC58F7F1B_4?cpp=%");</script><br/>The exponent.</dd><dt><spanclass="parameter">base</span></dt><dd>Type:<ahref="http://msdn2.microsoft.com/en-us/library/td2s409d"target="_blank">System<spanid="LSTC58F7F1B_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTC58F7F1B_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Int32</a><br/>The base.</dd><dt><spanclass="parameter">n_digits</span></dt><dd>Type:<ahref="d9761bfb-1882-59d2-e89b-c6460141f9a6.htm">Math.Gmp.Native<spanid="LSTC58F7F1B_6"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTC58F7F1B_6?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>size_t</a><br/>Maximum number of output digits.</dd><dt><spanclass="parameter">op</span></dt><dd>Type:<ahref="37c88d6c-8d02-2330-ad77-f20fb73d1677.htm">Math.Gmp.Native<spanid="LSTC58F7F1B_7"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTC58F7F1B_7?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpf_t</a><br/>The operand floating-point number.</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 2 to 62 or from -2 to -36.
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 0 then that accurate maximum number of digits are generated.
</p><p>
For <spanclass="parameter">base</span> in the range 2..36, digits and lower-case letters are used; for -2..-36,
digits and upper-case letters are used; for 37..62, 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 strlen(str) + 1 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="parameter">n_digits</span> + 2 bytes,
that being enough for the mantissa, a possible minus sign, and a null-terminator.
When <spanclass="parameter">n_digits</span> is 0 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 3.1416 would be returned as string "31416" and exponent 1.
</p><p>
When <spanclass="parameter">op</span> is zero, an empty string is produced and the exponent returned is 0.
</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>
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="73766ead-a037-a852-4589-04adc3407e15.htm">mpf_get_str Overload</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">mpf_get_d</a></div><divclass="seeAlsoStyle"><ahref="e1edc21e-74a0-b44c-216b-bad204b5a48a.htm">mpf_get_d_2exp</a></div><divclass="seeAlsoStyle"><ahref="d948e832-ee71-628a-6a7b-766138afff62.htm">mpf_get_si</a></div><divclass="seeAlsoStyle"><ahref="aa3fd0ea-a8b6-674b-59ff-b6d4785baed1.htm">mpf_get_ui</a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="/Math.Gmp.Native/html/3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm#Converting_Floats">Converting Floats</a></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>