Math.Gmp.Native/docs/html/db55f1a9-cd4c-b7e9-c831-439...

36 lines
11 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<html><head><meta http-equiv="X-UA-Compatible" content="IE=edge" /><link rel="shortcut icon" href="../icons/favicon.ico" /><link rel="stylesheet" type="text/css" href="../styles/branding.css" /><link rel="stylesheet" type="text/css" href="../styles/branding-en-US.css" /><script type="text/javascript" src="../scripts/branding.js"> </script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>mp_base._mp_d Property </title><meta name="Language" content="en-us" /><meta name="System.Keywords" content="_mp_d property" /><meta name="System.Keywords" content="mp_base._mp_d property" /><meta name="Microsoft.Help.F1" content="Math.Gmp.Native.mp_base._mp_d" /><meta name="Microsoft.Help.F1" content="Math.Gmp.Native.mp_base.get__mp_d" /><meta name="Microsoft.Help.Id" content="P:Math.Gmp.Native.mp_base._mp_d" /><meta name="Description" content="A pointer to an array of limbs which is the magnitude." /><meta name="Microsoft.Help.ContentType" content="Reference" /><meta name="BrandingAware" content="true" /><meta name="container" content="Math.Gmp.Native" /><meta name="file" content="db55f1a9-cd4c-b7e9-c831-4391c0497ef7" /><meta name="guid" content="db55f1a9-cd4c-b7e9-c831-4391c0497ef7" /><link rel="stylesheet" type="text/css" href="../styles/branding-Website.css" /><script type="text/javascript" src="../scripts/jquery-1.11.0.min.js"></script><script type="text/javascript" src="../scripts/branding-Website.js"></script><script type="text/javascript" src="../scripts/clipboard.min.js"></script></head><body onload="OnLoad('cs')"><input type="hidden" id="userDataCache" class="userDataStyle" /><div class="pageHeader" id="PageHeader">GMP Native Interface for .NET<form id="SearchForm" method="get" action="#" onsubmit="javascript:TransferToSearchPage(); return false;"><input id="SearchTextBox" type="text" maxlength="200" /><button id="SearchButton" type="submit"></button></form></div><div class="pageBody"><div class="leftNav" id="leftNav"><div id="tocNav"><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="846f5c8a-6cba-433e-9f18-cde2ff5695cd.htm" title="GMP Native Interface for .NET" tocid="roottoc">GMP Native Interface for .NET</a></div><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm" title="Math.Gmp.Native" tocid="d9c51b9f-0c54-770b-28ea-6eebd8fef368">Math.Gmp.Native</a></div><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="8f3c572b-8133-bccc-b838-9d22e3467898.htm" title="mp_base Class" tocid="8f3c572b-8133-bccc-b838-9d22e3467898">mp_base Class</a></div><div class="toclevel1" data-toclevel="1" data-childrenloaded="true"><a class="tocExpanded" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="c65a20b0-ddd8-db62-1d34-19bf1a71ce8c.htm" title="mp_base Properties" tocid="c65a20b0-ddd8-db62-1d34-19bf1a71ce8c">mp_base Properties</a></div><div class="toclevel2 current" data-toclevel="2"><a data-tochassubtree="false" href="db55f1a9-cd4c-b7e9-c831-4391c0497ef7.htm" title="_mp_d Property " tocid="db55f1a9-cd4c-b7e9-c831-4391c0497ef7">_mp_d Property </a></div><div class="toclevel2" data-toclevel="2"><a data-tochassubtree="false" href="01baafdb-caf3-5653-428f-0ba9c42c3a9a.htm" title="_mp_d_intptr Property " tocid="01baafdb-caf3-5653-428f-0ba9c42c3a9a">_mp_d_intptr Property </a></div><div class="toclevel2" data-toclevel="2"><a data-tochassubtree="false" href="178d8d44-2485-2972-fe2f-eb9848059e6f.htm" title="_mp_size Property " tocid="178d8d44-2485-2972-fe2f-eb9848059e6f">_mp_size Property </a></div></div><div id="tocResizableEW" onmousedown="OnMouseDown(event);"></div><div id="TocResize" class="tocResize"><img id="ResizeImageIncrease" src="../icons/TocOpen.gif" onclick="OnIncreaseToc()" alt="Click or drag to resize" title="Click or drag to resize" /><img id="ResizeImageReset" src="../icons/TocClose.gif" style="display:none" onclick="OnResetToc()" alt="Click or drag to resize" title="Click or drag to resize" /></div></div><div class="topicContent" id="TopicContent"><table class="titleTable"><tr><td class="titleColumn">mp_base<span id="LST71A5CF0F_0"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST71A5CF0F_0?cpp=::|nu=.");</script>_mp_d Property </td></tr></table><span class="introStyle"></span> <div class="summary">
A pointer to an array of limbs which is the magnitude.
</div><p> </p>
<strong>Namespace:</strong>
 <a href="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm">Math.Gmp.Native</a><br />
<strong>Assembly:</strong>
 Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)<div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('ID1RB')" onkeypress="SectionExpandCollapse_CheckKey('ID1RB', event)" tabindex="0"><img id="ID1RBToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Syntax</span></div><div id="ID1RBSection" class="collapsibleSection"><div class="codeSnippetContainer"><div class="codeSnippetContainerTabs"><div id="ID0EDCA_tab1" class="codeSnippetContainerTab"><a href="#" onclick="javascript:ChangeTab('ID0EDCA','cs','1','4');return false;">C#</a></div><div id="ID0EDCA_tab2" class="codeSnippetContainerTab"><a href="#" onclick="javascript:ChangeTab('ID0EDCA','vb','2','4');return false;">VB</a></div><div id="ID0EDCA_tab3" class="codeSnippetContainerTab"><a href="#" onclick="javascript:ChangeTab('ID0EDCA','cpp','3','4');return false;">C++</a></div><div id="ID0EDCA_tab4" class="codeSnippetContainerTab"><a href="#" onclick="javascript:ChangeTab('ID0EDCA','fs','4','4');return false;">F#</a></div></div><div class="codeSnippetContainerCodeContainer"><div class="codeSnippetToolBar"><div class="codeSnippetToolBarText"><a id="ID0EDCA_copyCode" href="#" class="copyCodeSnippet" onclick="javascript:CopyToClipboard('ID0EDCA');return false;" title="Copy">Copy</a></div></div><div id="ID0EDCA_code_Div1" class="codeSnippetContainerCode" style="display: block"><pre xml:space="preserve"><span class="keyword">public</span> <span class="keyword">virtual</span> <span class="identifier">mp_ptr</span> <span class="identifier">_mp_d</span> { <span class="keyword">get</span>; }</pre></div><div id="ID0EDCA_code_Div2" class="codeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">Public</span> <span class="keyword">Overridable</span> <span class="keyword">ReadOnly</span> <span class="keyword">Property</span> <span class="identifier">_mp_d</span> <span class="keyword">As</span> <span class="identifier">mp_ptr</span>
<span class="keyword">Get</span></pre></div><div id="ID0EDCA_code_Div3" class="codeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">public</span>:
<span class="keyword">virtual</span> <span class="keyword">property</span> <span class="identifier">mp_ptr</span>^ <span class="identifier">_mp_d</span> {
<span class="identifier">mp_ptr</span>^ <span class="keyword">get</span> ();
}</pre></div><div id="ID0EDCA_code_Div4" class="codeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">abstract</span> <span class="identifier">_mp_d</span> : <span class="identifier">mp_ptr</span> <span class="keyword">with</span> <span class="keyword">get</span>
<span class="keyword">override</span> <span class="identifier">_mp_d</span> : <span class="identifier">mp_ptr</span> <span class="keyword">with</span> <span class="keyword">get</span></pre></div></div></div><script type="text/javascript">AddLanguageTabSet("ID0EDCA");</script><h4 class="subHeading">Property Value</h4>Type: <a href="4609ac5e-5cf9-cd20-2fa9-8040101c165c.htm">mp_ptr</a></div><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('ID2RB')" onkeypress="SectionExpandCollapse_CheckKey('ID2RB', event)" tabindex="0"><img id="ID2RBToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Remarks</span></div><div id="ID2RBSection" class="collapsibleSection"><p>
In <a href="8beda7fb-bbc4-b56f-fd1f-1459377ecb3b.htm">mpz_t</a>:
</p><p>
A pointer to an array of limbs which is the magnitude.
These are stored “little endian” as per the mpn functions, so <span class="code"><span class="selflink">_mp_d</span>[0]</span>
is the least significant limb and <span class="code"><span class="selflink">_mp_d</span>[ABS(<a href="178d8d44-2485-2972-fe2f-eb9848059e6f.htm">_mp_size</a>) - 1]</span>
is the most significant.
Whenever <a href="178d8d44-2485-2972-fe2f-eb9848059e6f.htm">_mp_size</a> is non-zero, the most significant limb is non-zero.
</p><p>
Currently theres always at least one limb allocated, so for instance <a href="7daadb71-9f36-2848-86c4-ba1fba25fcfd.htm">gmp_lib.mpz_set_ui</a>
never needs to reallocate, and <a href="3a92eddc-59f3-b42f-9921-4e1cc5700d60.htm">gmp_lib.mpz_get_ui</a> can fetch <span class="code"><span class="selflink">_mp_d</span>[0]</span>
unconditionally (though its value is then only wanted if <a href="178d8d44-2485-2972-fe2f-eb9848059e6f.htm">_mp_size</a> is non-zero).
</p><p>
In <a href="8beda7fb-bbc4-b56f-fd1f-1459377ecb3b.htm">mpz_t</a>:
</p><p>
A pointer to the array of limbs which is the absolute value of the mantissa.
These are stored "little endian" as per the <span class="code">mpn</span> functions, so <span class="code">_mp_d[0]</span> is the least
significant limb and <span class="code">_mp_d[ABS(_mp_size)-1]</span> the most significant.
</p><p>
The most significant limb is always non-zero, but there are no other restrictions on its value,
in particular the highest <span class="code">1</span> bit can be anywhere within the limb.
</p><p><span class="code">_mp_prec + 1</span> limbs are allocated to <span class="selflink">mp_base._mp_d</span>, the extra limb being for
convenience (see below).
There are no reallocations during a calculation, only in a change of precision with <a href="438e6843-fc7b-4e6f-9ac0-d97a2773b032.htm">gmp_lib.mpf_set_prec</a>.
</p></div><div class="collapsibleAreaRegion" id="seeAlsoSection"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('ID3RB')" onkeypress="SectionExpandCollapse_CheckKey('ID3RB', event)" tabindex="0"><img id="ID3RBToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />See Also</span></div><div id="ID3RBSection" class="collapsibleSection"><h4 class="subHeading">Reference</h4><div class="seeAlsoStyle"><a href="8f3c572b-8133-bccc-b838-9d22e3467898.htm">mp_base Class</a></div><div class="seeAlsoStyle"><a href="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm">Math.Gmp.Native Namespace</a></div></div></div></div><div id="pageFooter" class="pageFooter"> </div></body></html>