The function is equivalent to calling <ahref="3a4e6141-0771-f9ac-2283-5e9348f86d4a.htm">mpz_set</a> with <ahref="a4c2958c-5957-d736-6883-ce7e76b3d7a4.htm">mpq_numref</a>.
Direct use of <ahref="a4c2958c-5957-d736-6883-ce7e76b3d7a4.htm">mpq_numref</a> is recommended instead of this functions.
</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 the value of op to -1 / 3.</span>
mpq_t op = <spanclass="highlight-keyword">new</span> mpq_t();
<spanclass="highlight-comment">// Release unmanaged memory allocated for op and num.</span>
gmp_lib.mpq_clear(op);
gmp_lib.mpz_clear(num);</pre></div><divid="ID0EDAABA_code_Div2"class="codeSnippetContainerCode"style="display: none"><prexml:space="preserve"><spanclass="highlight-comment">' Create, initialize, and set the value of op to -1 / 3.</span>
<spanclass="highlight-keyword">Dim</span> op <spanclass="highlight-keyword">As</span><spanclass="highlight-keyword">New</span> mpq_t()
gmp_lib.mpz_clear(num)</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="a4c2958c-5957-d736-6883-ce7e76b3d7a4.htm">mpq_numref</a></div><divclass="seeAlsoStyle"><ahref="2d93abcb-e73f-fe40-a50b-395a0bf6a4fc.htm">mpq_denref</a></div><divclass="seeAlsoStyle"><ahref="ae9e468d-e9ce-db55-1964-433829dfa476.htm">mpq_get_den </a></div><divclass="seeAlsoStyle"><ahref="6885ad71-c185-1e0c-abc8-4320e12f377a.htm">mpq_set_num</a></div><divclass="seeAlsoStyle"><ahref="52388f4c-575a-9b13-41a6-e7ec2bd0becd.htm">mpq_set_den</a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="/Math.Gmp.Native/html/3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm#Applying_Integer_Functions">Applying Integer Functions</a></a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="https://gmplib.org/manual/Applying-Integer-Functions.html#Applying-Integer-Functions">GNU MP - Applying Integer Functions</a></a></div></div></div></div><divid="pageFooter"class="pageFooter"></div></body></html>