</pre></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDCA");</script><h4class="subHeading">Parameters</h4><dl><dt><spanclass="parameter">rop</span></dt><dd>Type:<ahref="8beda7fb-bbc4-b56f-fd1f-1459377ecb3b.htm">Math.Gmp.Native<spanid="LSTE2235010_1"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTE2235010_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_t</a><br/>The result integer.</dd><dt><spanclass="parameter">max_size</span></dt><dd>Type:<ahref="4b58a584-7a0e-b600-18fa-ebd493861eb3.htm">Math.Gmp.Native<spanid="LSTE2235010_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTE2235010_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_size_t</a><br/>The maximum number of limbs.</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>
The generated random number doesn’t satisfy any particular requirements of randomness.
Negative random numbers are generated when <spanclass="parameter">max_size</span> is negative.
</p><p>
This function is obsolete. Use <ahref="c5fc473c-b8dc-8053-4199-e80d58a05230.htm">mpz_urandomb(mpz_t, gmp_randstate_t, mp_bitcnt_t)</a> or <ahref="981cfca4-f958-045f-84b7-01717fcd88d1.htm">mpz_urandomm(mpz_t, gmp_randstate_t, mpz_t)</a> instead.
</p><p>
The random number functions of GMP come in two groups; older function that rely on a global state,
and newer functions that accept a state parameter that is read and modified.
Please see the <ahref="https://gmplib.org/manual/Random-Number-Functions.html#Random-Number-Functions">GNU MP - Random Number Functions</a>
for more information on how to use and not to use random number 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 rop to 0.</span>
<spanclass="highlight-comment">// Free all memory occupied by state and rop.</span>
gmp_lib.mpz_clear(rop);</pre></div><divid="ID0EDAABA_code_Div2"class="codeSnippetContainerCode"style="display: none"><prexml:space="preserve"><spanclass="highlight-comment">' Create, initialize, and set the value of rop to 0.</span>
<spanclass="highlight-comment">' Free all memory occupied by state and rop.</span>
gmp_lib.mpz_clear(rop)</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="c5fc473c-b8dc-8053-4199-e80d58a05230.htm">gmp_lib<spanid="LSTE2235010_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTE2235010_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_urandomb(mpz_t, gmp_randstate_t, mp_bitcnt_t)</a></div><divclass="seeAlsoStyle"><ahref="981cfca4-f958-045f-84b7-01717fcd88d1.htm">gmp_lib<spanid="LSTE2235010_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTE2235010_4?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_urandomm(mpz_t, gmp_randstate_t, mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="4be917d3-47c6-cb58-d768-6276e78f0afb.htm">gmp_lib<spanid="LSTE2235010_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTE2235010_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_rrandomb(mpz_t, gmp_randstate_t, mp_bitcnt_t)</a></div><divclass="seeAlsoStyle"><ahref="cd88d27d-fb03-9e74-e353-4f0df7a38a96.htm">gmp_lib<spanid="LSTE2235010_6"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTE2235010_6?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_random2(mpz_t, mp_size_t)</a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="https://gmplib.org/manual/Integer-Random-Numbers.html#Integer-Random-Numbers">GNU MP - Integer Random Numbers</a></a></div></div></div></div><divid="pageFooter"class="pageFooter"></div></body></html>