</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="LST43C41447_1"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST43C41447_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_t</a><br/>The result integer.</dd><dt><spanclass="parameter">count</span></dt><dd>Type:<ahref="d9761bfb-1882-59d2-e89b-c6460141f9a6.htm">Math.Gmp.Native<spanid="LST43C41447_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST43C41447_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>size_t</a><br/>The number of words to read.</dd><dt><spanclass="parameter">order</span></dt><dd>Type:<ahref="http://msdn2.microsoft.com/en-us/library/td2s409d"target="_blank">System<spanid="LST43C41447_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST43C41447_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Int32</a><br/><spanclass="code">1</span> for most significant word first or <spanclass="code">-1</span> for least significant first.</dd><dt><spanclass="parameter">size</span></dt><dd>Type:<ahref="d9761bfb-1882-59d2-e89b-c6460141f9a6.htm">Math.Gmp.Native<spanid="LST43C41447_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST43C41447_4?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="LST43C41447_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST43C41447_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Int32</a><br/><spanclass="code">1</span> for most significant byte first, <spanclass="code">-1</span> for least significant first, or <spanclass="code">0</span> 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="LST43C41447_6"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST43C41447_6?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="e200d734-044d-4cc7-acc7-2333d7cf3c9a.htm">Math.Gmp.Native<spanid="LST43C41447_7"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST43C41447_7?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>void_ptr</a><br/>The operand integer.</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 parameters specify the format of the data.
<spanclass="parameter">count</span> many words are read, each <spanclass="parameter">size</span> bytes.
<spanclass="parameter">order</span> can be <spanclass="code">1</span> for most significant word first or <spanclass="code">-1</span> for least significant first.
Within each word endian can be <spanclass="code">1</span> for most significant byte first, <spanclass="code">-1</span> for least significant first, or <spanclass="code">0</span> for the native endianness of the host CPU.
The most significant <spanclass="parameter">nails</span> bits of each word are skipped, this can be <spanclass="code">0</span> to use the full words.
</p><p>
There is no sign taken from the data, <spanclass="parameter">rop</span> will simply be a positive integer.
An application can handle any sign itself, and apply it for instance with <ahref="5a61d62c-a0f0-5e86-b6dd-8ca6414b35ed.htm">mpz_neg(mpz_t, mpz_t)</a>.
</p><p>
There are no data alignment restrictions on <spanclass="parameter">op</span>, any address is allowed.
</p><p>
Here’s an example converting an array of unsigned long data, most significant element first, and host byte order within each value.
This example assumes the full <spanclass="code">sizeof</span> bytes are used for data in the given type, which is usually true,
and certainly true for unsigned long everywhere we know of. However on Cray vector systems it may be noted that <spanclass="code">short</span>
and <spanclass="code">int</span> are always stored in 8 bytes (and with <spanclass="code">sizeof</span> indicating that) but use only 32 or 46 bits.
The <spanclass="parameter">nails</span> feature can account for this, by passing for instance <spanclass="code">8 * sizeof(int) - INT_BIT</span>.
</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">// Copy 0x800000000000000000000001, 3 words of 4 bytes each, first word is lsb, and first byte in each word is msb.</span>
void_ptr data = gmp_lib.allocate(<spanclass="highlight-number">12</span>);
<spanclass="highlight-comment">// Release unmanaged memory allocated for rop, data, and value.</span>
gmp_lib.mpz_clear(rop);
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 rop to 0.</span>
<spanclass="highlight-comment">' Copy 0x800000000000000000000001, 3 words of 4 bytes each, first word is lsb, and first byte in each word is msb.</span>
<spanclass="highlight-keyword">Dim</span> data <spanclass="highlight-keyword">As</span> void_ptr = gmp_lib.allocate(<spanclass="highlight-number">12</span>)
<spanclass="highlight-comment">' Release unmanaged memory allocated for rop, data, and value.</span>
gmp_lib.mpz_clear(rop)
gmp_lib.free(data)
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="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm">Math.Gmp.Native Namespace</a></div><divclass="seeAlsoStyle"><ahref="c9d371c8-8c16-77a3-2c47-8edae05276c5.htm">gmp_lib<spanid="LST43C41447_8"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST43C41447_8?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mpz_export(void_ptr, size_t<spanid="LST43C41447_9"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LST43C41447_9?cpp=%");</script>, Int32, size_t, Int32, size_t, mpz_t)</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>