</pre></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDCA");</script><h4class="subHeading">Parameters</h4><dl><dt><spanclass="parameter">integer</span></dt><dd>Type:<ahref="8beda7fb-bbc4-b56f-fd1f-1459377ecb3b.htm">Math.Gmp.Native<spanid="LST797015E5_1"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_t</a><br/>The integer to resize.</dd><dt><spanclass="parameter">new_alloc</span></dt><dd>Type:<ahref="4b58a584-7a0e-b600-18fa-ebd493861eb3.htm">Math.Gmp.Native<spanid="LST797015E5_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_size_t</a><br/>The new 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 value in <spanclass="parameter">integer</span> is preserved if it fits, or is set to <spanclass="code">0</span> if not.
</p><p><ahref="1de9b70a-1d21-8168-e41c-1c259f64091a.htm">mpz_realloc2(mpz_t, mp_bitcnt_t)</a> is the preferred way to accomplish allocation changes like this.
<ahref="1de9b70a-1d21-8168-e41c-1c259f64091a.htm">mpz_realloc2(mpz_t, mp_bitcnt_t)</a> and <spanclass="selflink">_mpz_realloc(mpz_t, mp_size_t)</span> are the same except that
<spanclass="selflink">_mpz_realloc(mpz_t, mp_size_t)</span> takes its size in limbs.
</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 and initialize new integer x.</span>
mpz_t x = <spanclass="highlight-keyword">new</span> mpz_t();
gmp_lib.mpz_init(x);
<spanclass="highlight-comment">// Set the value of x to a 77-bit integer.</span>
gmp_lib.free(s);</pre></div><divid="ID0EDAABA_code_Div2"class="codeSnippetContainerCode"style="display: none"><prexml:space="preserve"><spanclass="highlight-comment">' Create and initialize new integer x.</span>
<spanclass="highlight-keyword">Dim</span> x <spanclass="highlight-keyword">As</span><spanclass="highlight-keyword">New</span> mpz_t()
gmp_lib.mpz_init(x)
<spanclass="highlight-comment">' Set the value of x to a 77-bit integer.</span>
<spanclass="highlight-keyword">Dim</span> value <spanclass="highlight-keyword">As</span><spanclass="highlight-keyword">New</span> char_ptr(<spanclass="highlight-literal">"1000 0000 0000 0000 0000"</span>)
<spanclass="highlight-comment">' Release unmanaged memory allocated for x and string values.</span>
gmp_lib.mpz_clear(x)
gmp_lib.free(value)
gmp_lib.free(s)</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="1de9b70a-1d21-8168-e41c-1c259f64091a.htm">gmp_lib<spanid="LST797015E5_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_realloc2(mpz_t, mp_bitcnt_t)</a></div><divclass="seeAlsoStyle"><ahref="1dfbf5da-f4c2-bbab-5708-3b31d40e4f16.htm">gmp_lib<spanid="LST797015E5_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_4?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_getlimbn(mpz_t, mp_size_t)</a></div><divclass="seeAlsoStyle"><ahref="9a169dd9-42b0-ea59-abbe-4efc6b870c75.htm">gmp_lib<spanid="LST797015E5_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_size(mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="4b08344c-f506-a717-4e1d-112cd19f5286.htm">gmp_lib<spanid="LST797015E5_6"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_6?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_limbs_read(mpz_t)</a></div><divclass="seeAlsoStyle"><ahref="86ddbf69-57f6-af58-bd13-3eca06123b29.htm">gmp_lib<spanid="LST797015E5_7"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_7?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_limbs_write(mpz_t, mp_size_t)</a></div><divclass="seeAlsoStyle"><ahref="87f5432d-aacb-57b6-b4a7-e4dc803684a4.htm">gmp_lib<spanid="LST797015E5_8"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_8?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_limbs_modify(mpz_t, mp_size_t)</a></div><divclass="seeAlsoStyle"><ahref="398e3eb8-0f55-086f-a765-0a8b3c9307e0.htm">gmp_lib<spanid="LST797015E5_9"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_9?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_limbs_finish(mpz_t, mp_size_t)</a></div><divclass="seeAlsoStyle"><ahref="5786e0c6-2dde-406f-b86d-3df6757c80c0.htm">gmp_lib<spanid="LST797015E5_10"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST797015E5_10?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_roinit_n(mpz_t, mp_ptr, mp_size_t)</a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="https://gmplib.org/manual/Integer-Special-Functions.html#Integer-Special-Functions">GNU MP - Integer Special Functions</a></a></div></div></div></div><divid="pageFooter"class="pageFooter"></div></body></html>