</pre></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDCA");</script><h4class="subHeading">Parameters</h4><dl><dt><spanclass="parameter">rop</span></dt><dd>Type:<ahref="e200d734-044d-4cc7-acc7-2333d7cf3c9a.htm">Math.Gmp.Native<spanid="LSTCFF43A25_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTCFF43A25_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>void_ptr</a><br/>The result integer.</dd><dt><spanclass="parameter">countp</span></dt><dd>Type:<ahref="542faa00-d28a-72a2-2dd8-6c6021e683ce.htm">Math.Gmp.Native<spanid="LSTCFF43A25_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTCFF43A25_4?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>ptr</a><spanid="LSTCFF43A25_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTCFF43A25_5?cs=<|vb=(Of |cpp=<|fs=<'|nu=(");</script><ahref="d9761bfb-1882-59d2-e89b-c6460141f9a6.htm">size_t</a><spanid="LSTCFF43A25_6"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTCFF43A25_6?cs=>|vb=)|cpp=>|fs=>|nu=)");</script><br/>The number of words produced.</dd><dt><spanclass="parameter">order</span></dt><dd>Type:<ahref="http://msdn2.microsoft.com/en-us/library/td2s409d"target="_blank">System<spanid="LSTCFF43A25_7"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTCFF43A25_7?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Int32</a><br/>1 for most significant word first or -1 for least significant first.</dd><dt><spanclass="parameter">size</span></dt><dd>Type:<ahref="d9761bfb-1882-59d2-e89b-c6460141f9a6.htm">Math.Gmp.Native<spanid="LSTCFF43A25_8"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTCFF43A25_8?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>size_t</a><br/>The number of bytes in each word.</dd><dt><spanclass="parameter">endian</span></dt><dd>Type:<ahref="http://msdn2.microsoft.com/en-us/library/td2s409d"target="_blank">System<spanid="LSTCFF43A25_9"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTCFF43A25_9?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Int32</a><br/>1 for most significant byte first, -1 for least significant first, or 0 for the native endianness of the host CPU.</dd><dt><spanclass="parameter">nails</span></dt><dd>Type:<ahref="d9761bfb-1882-59d2-e89b-c6460141f9a6.htm">Math.Gmp.Native<spanid="LSTCFF43A25_10"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTCFF43A25_10?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>size_t</a><br/>The number of most significant bits to skip.</dd><dt><spanclass="parameter">op</span></dt><dd>Type:<ahref="8beda7fb-bbc4-b56f-fd1f-1459377ecb3b.htm">Math.Gmp.Native<spanid="LSTCFF43A25_11"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTCFF43A25_11?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_t</a><br/>The operand integer.</dd></dl><h4class="subHeading">Return Value</h4>Type:<ahref="e200d734-044d-4cc7-acc7-2333d7cf3c9a.htm">void_ptr</a><br/>Either <spanclass="parameter">rop</span> or the allocated block.</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 parameters specify the format of the data produced.
Each word will be <spanclass="parameter">size</span> bytes and <spanclass="parameter">order</span> can be 1 for most significant word first
or -1 for least significant first.
Within each word <spanclass="parameter">endian</span> can be 1 for most significant byte first,
-1 for least significant first, or 0 for the native endianness of the host CPU.
The most significant <spanclass="parameter">nails</span> bits of each word are unused and set to zero,
this can be 0 to produce full words.
</p><p>
The number of words produced is written to <spanclass="parameter">countp</span>, or <spanclass="parameter">countp</span> can be NULL to discard the count.
<spanclass="parameter">rop</span> must have enough space for the data, or if <spanclass="parameter">rop</span> is NULL then a result array of the necessary
size is allocated using the current GMP allocation function
(see <ahref="https://gmplib.org/manual/Custom-Allocation.html#Custom-Allocation">GNU MP - Custom Allocation</a>).
In either case the return value is the destination used, either <spanclass="parameter">rop</span> or the allocated block.
</p><p>
If <spanclass="parameter">op</span> is non-zero then the most significant word produced will be non-zero.
If <spanclass="parameter">op</span> is zero then the count returned will be zero and nothing written to <spanclass="parameter">rop</span>.
If <spanclass="parameter">rop</span> is NULL in this case, no block is allocated, just NULL is returned.
</p><p>
The sign of <spanclass="parameter">op</span> is ignored, just the absolute value is exported.
Since <ahref="7dfe367e-74d3-e782-860b-2314da9c44cf.htm">mpz_sizeinbase</a> always returns at least 1, count here will be at least one, which avoids any portability
p = malloc(count * size);</pre></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EAAEBA");</script></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 0x800000000000000000000001.</span>
<spanclass="highlight-comment">// Assert the result.</span>
<spanclass="highlight-keyword">byte</span>[] result = <spanclass="highlight-keyword">new</span><spanclass="highlight-keyword">byte</span>[<spanclass="highlight-number">12</span>];
<spanclass="highlight-comment">// Release unmanaged memory allocated for rop, data, and value.</span>
gmp_lib.mpz_clear(op);
gmp_lib.free(data);
gmp_lib.free(<spanclass="highlight-keyword">value</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 op to 0x800000000000000000000001.</span>
<spanclass="highlight-keyword">Dim</span> op <spanclass="highlight-keyword">As</span><spanclass="highlight-keyword">New</span> mpz_t()
<spanclass="highlight-keyword">Dim</span> value <spanclass="highlight-keyword">As</span><spanclass="highlight-keyword">New</span> char_ptr(<spanclass="highlight-literal">"800000000000000000000001"</span>)
gmp_lib.free(value)</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="5fbffc1a-1ac4-6ca6-e528-abe7f8c96667.htm">mpz_export Overload</a></div><divclass="seeAlsoStyle"><ahref="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm">Math.Gmp.Native Namespace</a></div><divclass="seeAlsoStyle"><ahref="8c8c1e55-275f-cff8-2152-883a4eaa163c.htm">mpz_import</a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="/Math.Gmp.Native/html/3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm#Integer_Import_and_Export">Integer Import and Export</a></a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="https://gmplib.org/manual/Integer-Import-and-Export.html#Integer-Import-and-Export">GNU MP - Integer Import and Export</a></a></div></div></div></div><divid="pageFooter"class="pageFooter"></div></body></html>