diff options
Diffstat (limited to 'files/pl/web/javascript/referencje/obiekty/bigint/asintn/index.html')
| -rw-r--r-- | files/pl/web/javascript/referencje/obiekty/bigint/asintn/index.html | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/files/pl/web/javascript/referencje/obiekty/bigint/asintn/index.html b/files/pl/web/javascript/referencje/obiekty/bigint/asintn/index.html deleted file mode 100644 index f3d7de5b66..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/bigint/asintn/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: BigInt.asIntN() -slug: Web/JavaScript/Referencje/Obiekty/BigInt/asIntN -tags: - - BigInt - - JavaScript - - Metodă - - Referencja - - asIntN -translation_of: Web/JavaScript/Reference/Global_Objects/BigInt/asIntN ---- -<div>{{JSRef}}</div> - -<p>Metoda statyczna <strong><code>BigInt.asIntN</code></strong> jest używana do opakowywania wartości BigInt w wartości całkowite ze znakiem w zakresie od -2<sup>szerokość-1</sup> do 2<sup>szerokość-1</sup>-1.</p> - -<div>{{EmbedInteractiveExample("pages/js/bigint-asintn.html", "taller")}}</div> - -<div class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> and send us a pull request.</div> - -<h2 id="Składnia">Składnia</h2> - -<pre class="syntaxbox">BigInt.asIntN(<em>szerokość</em>, <var>bigint</var>);</pre> - -<h3 id="Parametry">Parametry</h3> - -<dl> - <dt><code><var>szerokość</var></code></dt> - <dd>Liczba bitów dostępnych dla rozmiaru wartości całkowitej (integer).</dd> - <dt><code><var>bigint</var></code></dt> - <dd>Wartość całkowita, którą chcemy wpasować w daną liczbę bitów.</dd> -</dl> - -<h3 id="Wynik">Wynik</h3> - -<p>Wartość <code><var>bigint</var></code> modulo 2<sup><code><var>szerokość</var></code></sup> jako liczba całkowita ze znakiem.</p> - -<h2 id="Przykłady">Przykłady</h2> - -<h3 id="Pozostawanie_w_zakresie_arytmetyki_64-bitowej">Pozostawanie w zakresie arytmetyki 64-bitowej</h3> - -<p>Metoda <code>BigInt.asIntN()</code> może być użyteczna do tego, by pozostać w zakresie obliczeń arytmetyki 64-bitowej.</p> - -<pre class="brush: js">const max = 2n ** (64n - 1n) - 1n; - -BigInt.asIntN(64, max); -// ↪ 9223372036854775807n - -BigInt.asIntN(64, max + 1n); -// ↪ -9223372036854775807n -// wartość ujemna ze względu na przepełnienie -</pre> - -<h2 id="Specyfikacje">Specyfikacje</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Specyfikacja</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('ESDraft', '#sec-bigint.asintn', 'BigInt.asIntN()')}}</td> - </tr> - </tbody> -</table> - -<h2 id="Wsparcie_przeglądarek">Wsparcie przeglądarek</h2> - - - -<p>{{Compat("javascript.builtins.BigInt.asIntN")}}</p> - -<h2 id="Zobacz_też">Zobacz też</h2> - -<ul> - <li>{{JSxRef("BigInt")}}</li> - <li>{{JSxRef("BigInt.asUintN()")}}</li> -</ul> |
