<html><head><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><linkrel="shortcut icon"href="../icons/favicon.ico"/><linkrel="stylesheet"type="text/css"href="../styles/branding.css"/><linkrel="stylesheet"type="text/css"href="../styles/branding-en-US.css"/><scripttype="text/javascript"src="../scripts/branding.js"></script><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>mp_base._mp_d Property </title><metaname="Language"content="en-us"/><metaname="System.Keywords"content="_mp_d property"/><metaname="System.Keywords"content="mp_base._mp_d property"/><metaname="Microsoft.Help.F1"content="Math.Gmp.Native.mp_base._mp_d"/><metaname="Microsoft.Help.F1"content="Math.Gmp.Native.mp_base.get__mp_d"/><metaname="Microsoft.Help.Id"content="P:Math.Gmp.Native.mp_base._mp_d"/><metaname="Description"content="A pointer to an array of limbs which is the magnitude."/><metaname="Microsoft.Help.ContentType"content="Reference"/><metaname="BrandingAware"content="true"/><metaname="container"content="Math.Gmp.Native"/><metaname="file"content="db55f1a9-cd4c-b7e9-c831-4391c0497ef7"/><metaname="guid"content="db55f1a9-cd4c-b7e9-c831-4391c0497ef7"/><linkrel="stylesheet"type="text/css"href="../styles/branding-Website.css"/><scripttype="text/javascript"src="../scripts/jquery-1.11.0.min.js"></script><scripttype="text/javascript"src="../scripts/branding-Website.js"></script><scripttype="text/javascript"src="../scripts/clipboard.min.js"></script></head><bodyonload="OnLoad('cs')"><inputtype="hidden"id="userDataCache"class="userDataStyle"/><divclass="pageHeader"id="PageHeader">GMP Native Interface for .NET<formid="SearchForm"method="get"action="#"onsubmit="javascript:TransferToSearchPage(); return false;"><inputid="SearchTextBox"type="text"maxlength="200"/><buttonid="SearchButton"type="submit"></button></form></div><divclass="pageBody"><divclass="leftNav"id="leftNav"><divid="tocNav"><divclass="toclevel0"data-toclevel="0"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="846f5c8a-6cba-433e-9f18-cde2ff5695cd.htm"title="GMP Native Interface for .NET"tocid="roottoc">GMP Native Interface for .NET</a></div><divclass="toclevel0"data-toclevel="0"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm"title="Math.Gmp.Native"tocid="d9c51b9f-0c54-770b-28ea-6eebd8fef368">Math.Gmp.Native</a></div><divclass="toclevel0"data-toclevel="0"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="8f3c572b-8133-bccc-b838-9d22e3467898.htm"title="mp_base Class"tocid="8f3c572b-8133-bccc-b838-9d22e3467898">mp_base Class</a></div><divclass="toclevel1"data-toclevel="1"data-childrenloaded="true"><aclass="tocExpanded"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="c65a20b0-ddd8-db62-1d34-19bf1a71ce8c.htm"title="mp_base Properties"tocid="c65a20b0-ddd8-db62-1d34-19bf1a71ce8c">mp_base Properties</a></div><divclass="toclevel2 current"data-toclevel="2"><adata-tochassubtree="false"href="db55f1a9-cd4c-b7e9-c831-4391c0497ef7.htm"title="_mp_d Property "tocid="db55f1a9-cd4c-b7e9-c831-4391c0497ef7">_mp_d Property </a></div><divclass="toclevel2"data-toclevel="2"><adata-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><divclass="toclevel2"data-toclevel="2"><adata-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><divid="tocResizableEW"onmousedown="OnMouseDown(event);"></div><divid="TocResize"class="tocResize"><imgid="ResizeImageIncrease"src="../icons/TocOpen.gif"onclick="OnIncreaseToc()"alt="Click or drag to resize"title="Click or drag to resize"/><imgid="ResizeIm
In <ahref="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 <spanclass="code"><spanclass="selflink">_mp_d</span>[0]</span>
is the least significant limb and <spanclass="code"><spanclass="selflink">_mp_d</span>[ABS(<ahref="178d8d44-2485-2972-fe2f-eb9848059e6f.htm">_mp_size</a>) - 1]</span>
is the most significant.
Whenever <ahref="178d8d44-2485-2972-fe2f-eb9848059e6f.htm">_mp_size</a> is non-zero, the most significant limb is non-zero.
Currently there’s always at least one limb allocated, so for instance <ahref="7daadb71-9f36-2848-86c4-ba1fba25fcfd.htm">gmp_lib.mpz_set_ui</a>
never needs to reallocate, and <ahref="3a92eddc-59f3-b42f-9921-4e1cc5700d60.htm">gmp_lib.mpz_get_ui</a> can fetch <spanclass="code"><spanclass="selflink">_mp_d</span>[0]</span>
There are no reallocations during a calculation, only in a change of precision with <ahref="438e6843-fc7b-4e6f-9ac0-d97a2773b032.htm">gmp_lib.mpf_set_prec</a>.