<html><head><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><linkrel="shortcut icon"href="../icons/favicon.ico"/><linkrel="stylesheet"type="text/css"href="../styles/branding.css"/><linkrel="stylesheet"type="text/css"href="../styles/branding-en-US.css"/><scripttype="text/javascript"src="../scripts/branding.js"></script><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>gmp_lib.mpz_tdiv_r_ui Method </title><metaname="Language"content="en-us"/><metaname="System.Keywords"content="mpz_tdiv_r_ui method"/><metaname="System.Keywords"content="gmp_lib.mpz_tdiv_r_ui method"/><metaname="Microsoft.Help.F1"content="Math.Gmp.Native.gmp_lib.mpz_tdiv_r_ui"/><metaname="Microsoft.Help.Id"content="M:Math.Gmp.Native.gmp_lib.mpz_tdiv_r_ui(Math.Gmp.Native.mpz_t,Math.Gmp.Native.mpz_t,System.UInt32)"/><metaname="Description"content="Set the remainder to - q * where q = trunc( / ), and return | |."/><metaname="Microsoft.Help.ContentType"content="Reference"/><metaname="BrandingAware"content="true"/><metaname="container"content="Math.Gmp.Native"/><metaname="file"content="a58b3e42-f5e9-42d3-e71a-2a6f68dec3a9"/><metaname="guid"content="a58b3e42-f5e9-42d3-e71a-2a6f68dec3a9"/><linktype="text/css"rel="stylesheet"href="../styles/highlight.css"/><scripttype="text/javascript"src="../scripts/highlight.js"></script><linkrel="stylesheet"type="text/css"href="../styles/branding-Website.css"/><scripttype="text/javascript"src="../scripts/jquery-1.11.0.min.js"></script><scripttype="text/javascript"src="../scripts/branding-Website.js"></script><scripttype="text/javascript"src="../scripts/clipboard.min.js"></script></head><bodyonload="OnLoad('cs')"><inputtype="hidden"id="userDataCache"class="userDataStyle"/><divclass="pageHeader"id="PageHeader">GMP Native Interface for .NET<formid="SearchForm"method="get"action="#"onsubmit="javascript:TransferToSearchPage(); return false;"><inputid="SearchTextBox"type="text"maxlength="200"/><buttonid="SearchButton"type="submit"></button></form></div><divclass="pageBody"><divclass="leftNav"id="leftNav"><divid="tocNav"><divclass="toclevel0"data-toclevel="0"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="846f5c8a-6cba-433e-9f18-cde2ff5695cd.htm"title="GMP Native Interface for .NET"tocid="roottoc">GMP Native Interface for .NET</a></div><divclass="toclevel0"data-toclevel="0"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm"title="Math.Gmp.Native"tocid="d9c51b9f-0c54-770b-28ea-6eebd8fef368">Math.Gmp.Native</a></div><divclass="toclevel0"data-toclevel="0"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"title="gmp_lib Class"tocid="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f">gmp_lib Class</a></div><divclass="toclevel1"data-toclevel="1"data-childrenloaded="true"><aclass="tocExpanded"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="0fa7cbf3-e8f4-6b14-d829-8aa663e77c74.htm"title="gmp_lib Methods"tocid="0fa7cbf3-e8f4-6b14-d829-8aa663e77c74">gmp_lib Methods</a></div><divclass="toclevel2"data-toclevel="2"><adata-tochassubtree="false"href="c9cb6a67-59b8-5c03-f31d-f252441c53f6.htm"title="_mpz_realloc Method "tocid="c9cb6a67-59b8-5c03-f31d-f252441c53f6">_mpz_realloc Method </a></div><divclass="toclevel2"data-toclevel="2"><adata-tochassubtree="false"href="2c68671c-cd5c-e2ec-52a2-65b0ca31c3d1.htm"title="allocate Method "tocid="2c68671c-cd5c-e2ec-52a2-65b0ca31c3d1">allocate Method </a></div><divclass="toclevel2"data-toclevel="2"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="92160da3-b1af-e005-cb05-e3fb4dd524d8.htm"title="free Method "tocid="92160da3-b1af-e005-cb05-e3fb4dd524d8">free Method </a></div><divclass="toclevel2"data-toclevel="2"><adata-tochassubtre
Set the remainder <spanclass="parameter">r</span> to <spanclass="parameter">n</span> - q * <spanclass="parameter">d</span> where q = trunc(<spanclass="parameter">n</span> / <spanclass="parameter">d</span>), and return | <spanclass="parameter">r</span> |.
</pre></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDCA");</script><h4class="subHeading">Parameters</h4><dl><dt><spanclass="parameter">r</span></dt><dd>Type:<ahref="8beda7fb-bbc4-b56f-fd1f-1459377ecb3b.htm">Math.Gmp.Native<spanid="LST894FD727_1"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_t</a><br/>The result remainder integer.</dd><dt><spanclass="parameter">n</span></dt><dd>Type:<ahref="8beda7fb-bbc4-b56f-fd1f-1459377ecb3b.htm">Math.Gmp.Native<spanid="LST894FD727_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_t</a><br/>The numerator integer.</dd><dt><spanclass="parameter">d</span></dt><dd>Type:<ahref="http://msdn2.microsoft.com/en-us/library/ctys3981"target="_blank">System<spanid="LST894FD727_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>UInt32</a><br/>The denominator integer.</dd></dl><h4class="subHeading">Return Value</h4>Type:<ahref="http://msdn2.microsoft.com/en-us/library/06cf7918"target="_blank">UInt64</a><br/>Return | <spanclass="parameter">r</span> |.</div><divclass="collapsibleAreaRegion"><spanclass="collapsibleRegionTitle"onclick="SectionExpandCollapse('ID2RB')"onkeypress="SectionExpandCollapse_CheckKey('ID2RB', event)"tabindex="0"><imgid="ID2RBToggle"class="collapseToggle"src="../icons/SectionExpanded.png"/>Examples</span></div><divid="ID2RBSection"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 n to 10000.</span>
<spanclass="highlight-comment">// Release unmanaged memory allocated for n and r.</span>
gmp_lib.mpz_clears(n, r, <spanclass="highlight-keyword">null</span>);</pre></div><divid="ID0EDAABA_code_Div2"class="codeSnippetContainerCode"style="display: none"><prexml:space="preserve"><spanclass="highlight-comment">' Create, initialize, and set the value of n to 10000.</span>
<spanclass="highlight-keyword">Dim</span> n <spanclass="highlight-keyword">As</span><spanclass="highlight-keyword">New</span> mpz_t()
<spanclass="highlight-comment">' Release unmanaged memory allocated for n and r.</span>
gmp_lib.mpz_clears(n, r, <spanclass="highlight-keyword">Nothing</span>)</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('ID3RB')"onkeypress="SectionExpandCollapse_CheckKey('ID3RB', event)"tabindex="0"><imgid="ID3RBToggle"class="collapseToggle"src="../icons/SectionExpanded.png"/>See Also</span></div><divid="ID3RBSection"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="7f89c102-d1eb-2dab-0e6e-061893309c4b.htm">gmp_lib<spanid="LST894FD727_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_4?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_cdiv_qr(mpz_t, mpz_t, mpz_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="2ff1eb0a-f399-2ad2-f7d1-3fb51dceac10.htm">gmp_lib<spanid="LST894FD727_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_congruent_p(mpz_t, mpz_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="2ddc32dc-4ee3-18e9-dd3d-7e64c3304e1e.htm">gmp_lib<spanid="LST894FD727_6"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_6?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_divexact(mpz_t, mpz_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="4bafc7fe-d2a8-7cf2-b9b8-c296550b4ef2.htm">gmp_lib<spanid="LST894FD727_7"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_7?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_divisible_p(mpz_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="d9ab5220-69aa-8e5d-8d15-375eb27149ad.htm">gmp_lib<spanid="LST894FD727_8"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_8?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_fdiv_qr(mpz_t, mpz_t, mpz_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="8d141ae9-4a01-bdc9-caf3-8daba3321ac1.htm">gmp_lib<spanid="LST894FD727_9"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_9?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_mod(mpz_t, mpz_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="4c830876-cdf6-9d94-1ceb-24d30f873bc2.htm">gmp_lib<spanid="LST894FD727_10"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_10?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_tdiv_q(mpz_t, mpz_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="beb982a6-fa8e-6a0f-409a-bce1fddb6002.htm">gmp_lib<spanid="LST894FD727_11"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_11?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_tdiv_r(mpz_t, mpz_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="387ec1dd-15b3-4cc9-862a-e3f0a8e2cb78.htm">gmp_lib<spanid="LST894FD727_12"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_12?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_tdiv_qr(mpz_t, mpz_t, mpz_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="67fc54a2-05e7-bc3c-64f4-8c6de48fa6b6.htm">gmp_lib<spanid="LST894FD727_13"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_13?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_tdiv_q_ui(mpz_t, mpz_t, UInt32)</a></div><divclass="seeAlsoStyle"><ahref="d5b95352-7b5e-881b-136a-b78fd8e033ff.htm">gmp_lib<spanid="LST894FD727_14"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST894FD727_14?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_tdiv_qr_ui(mp