Divide {<spanclass="parameter">np</span>, <spanclass="parameter">nn</span>} by {<spanclass="parameter">dp</span>, <spanclass="parameter">dn</span>} and put the quotient at {<spanclass="parameter">qp</span>, <spanclass="parameter">nn</span> - <spanclass="parameter">dn</span> + 1} and the remainder at {<spanclass="parameter">rp</span>, <spanclass="parameter">dn</span>}.
</pre></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDCA");</script><h4class="subHeading">Parameters</h4><dl><dt><spanclass="parameter">qp</span></dt><dd>Type:<ahref="4609ac5e-5cf9-cd20-2fa9-8040101c165c.htm">Math.Gmp.Native<spanid="LST806B9DDE_1"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_ptr</a><br/>The result quotient integer.</dd><dt><spanclass="parameter">rp</span></dt><dd>Type:<ahref="4609ac5e-5cf9-cd20-2fa9-8040101c165c.htm">Math.Gmp.Native<spanid="LST806B9DDE_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_ptr</a><br/>The result remainder integer.</dd><dt><spanclass="parameter">qxn</span></dt><dd>Type:<ahref="4b58a584-7a0e-b600-18fa-ebd493861eb3.htm">Math.Gmp.Native<spanid="LST806B9DDE_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_size_t</a><br/>Must be 0.</dd><dt><spanclass="parameter">np</span></dt><dd>Type:<ahref="4609ac5e-5cf9-cd20-2fa9-8040101c165c.htm">Math.Gmp.Native<spanid="LST806B9DDE_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_4?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_ptr</a><br/>The numerator operand integer.</dd><dt><spanclass="parameter">nn</span></dt><dd>Type:<ahref="4b58a584-7a0e-b600-18fa-ebd493861eb3.htm">Math.Gmp.Native<spanid="LST806B9DDE_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_size_t</a><br/>The number of limbs of <spanclass="parameter">np</span>.</dd><dt><spanclass="parameter">dp</span></dt><dd>Type:<ahref="4609ac5e-5cf9-cd20-2fa9-8040101c165c.htm">Math.Gmp.Native<spanid="LST806B9DDE_6"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_6?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_ptr</a><br/>The denominator operand integer.</dd><dt><spanclass="parameter">dn</span></dt><dd>Type:<ahref="4b58a584-7a0e-b600-18fa-ebd493861eb3.htm">Math.Gmp.Native<spanid="LST806B9DDE_7"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_7?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_size_t</a><br/>The number of limbs of <spanclass="parameter">dp</span>.</dd></dl></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>
mp_ptr rp = <spanclass="highlight-keyword">new</span> mp_ptr(<spanclass="highlight-keyword">new</span><spanclass="highlight-keyword">uint</span>[dp.Size]);
gmp_lib.free(qp, rp, np, dp, quotient, remainder)</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="b9df04c4-224e-f2ad-8e90-fbb3b30bd76d.htm">gmp_lib<spanid="LST806B9DDE_8"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_8?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_add(mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t)</a></div><divclass="seeAlsoStyle"><ahref="5562b14f-48a4-be75-2eb0-6a129cd0d5ab.htm">gmp_lib<spanid="LST806B9DDE_9"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_9?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_add_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t)</a></div><divclass="seeAlsoStyle"><ahref="339edb73-5781-7d73-97b6-9b73451a698f.htm">gmp_lib<spanid="LST806B9DDE_10"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_10?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_add_n(mp_ptr, mp_ptr, mp_ptr, mp_size_t)</a></div><divclass="seeAlsoStyle"><ahref="77fdf32b-986d-4df3-3c76-022e3e3fbb98.htm">gmp_lib<spanid="LST806B9DDE_11"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_11?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_addmul_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t)</a></div><divclass="seeAlsoStyle"><ahref="1d6343a5-d42c-c362-714e-e10730e6a6d5.htm">gmp_lib<spanid="LST806B9DDE_12"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_12?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_divexact_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t)</a></div><divclass="seeAlsoStyle"><ahref="75f2a84e-44f3-b7cc-e6ad-392111d5b9cc.htm">gmp_lib<spanid="LST806B9DDE_13"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_13?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_divexact_by3(mp_ptr, mp_ptr, mp_size_t)</a></div><divclass="seeAlsoStyle"><ahref="c40ea3de-d1be-146b-fe7a-deff566ca817.htm">gmp_lib<spanid="LST806B9DDE_14"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_14?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_divexact_by3c(mp_ptr, mp_ptr, mp_size_t, mp_limb_t)</a></div><divclass="seeAlsoStyle"><ahref="9074a45b-0d68-cf18-75fe-076e720a9a61.htm">gmp_lib<spanid="LST806B9DDE_15"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_15?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_divmod_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t)</a></div><divclass="seeAlsoStyle"><ahref="f5c3f25d-1ad5-b3be-fc4b-280a62869912.htm">gmp_lib<spanid="LST806B9DDE_16"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_16?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_divrem_1(mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_limb_t)</a></div><divclass="seeAlsoStyle"><ahref="9aa24cc8-8cf5-4b8a-cd1b-5ded400efa50.htm">gmp_lib<spanid="LST806B9DDE_17"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST806B9DDE_17?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpn_mod_1(mp_ptr, mp_size_t, mp_limb_t)</a></div><divclass="seeAlsoStyle"><ahref="68d3161d-2909-1909-cda7-e87949ee27ce.htm">gmp_lib<spanid="LST806B9DDE_1