diff options
| author | Ryan Johnson <rjohnson@mozilla.com> | 2021-04-29 16:16:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-29 16:16:42 -0700 |
| commit | 95aca4b4d8fa62815d4bd412fff1a364f842814a (patch) | |
| tree | 5e57661720fe9058d5c7db637e764800b50f9060 /files/uk/web/javascript/reference/global_objects/math/log2/index.html | |
| parent | ee3b1c87e3c8e72ca130943eed260ad642246581 (diff) | |
| download | translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.gz translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.bz2 translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.zip | |
remove retired locales (#699)
Diffstat (limited to 'files/uk/web/javascript/reference/global_objects/math/log2/index.html')
| -rw-r--r-- | files/uk/web/javascript/reference/global_objects/math/log2/index.html | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/files/uk/web/javascript/reference/global_objects/math/log2/index.html b/files/uk/web/javascript/reference/global_objects/math/log2/index.html deleted file mode 100644 index 43e87c72f8..0000000000 --- a/files/uk/web/javascript/reference/global_objects/math/log2/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: Math.log2() -slug: Web/JavaScript/Reference/Global_Objects/Math/log2 -tags: - - ECMAScript 2015 - - JavaScript - - Math - - Довідка - - метод -translation_of: Web/JavaScript/Reference/Global_Objects/Math/log2 ---- -<div>{{JSRef}}</div> - -<p>Функція <strong><code>Math.log2()</code></strong> повертає логарифм за основою 2 від числа. Інакше кажучи,</p> - -<p><math display="block"><semantics><mrow><mo>∀</mo><mi>x</mi><mo>></mo><mn>0</mn><mo>,</mo><mstyle mathvariant="monospace"><mrow><mo lspace="0em" rspace="thinmathspace">Math.log2</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle><mo>=</mo><msub><mo lspace="0em" rspace="0em">log</mo><mn>2</mn></msub><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mtext>такий унікальній</mtext><mspace width="thickmathspace"></mspace><mi>y,</mi><mspace width="thickmathspace"></mspace><mtext>для якого</mtext><mspace width="thickmathspace"></mspace><msup><mn>2</mn><mi>y</mi></msup><mo>=</mo><mi>x</mi></mrow><annotation encoding="TeX">\forall x > 0, \mathtt{\operatorname{Math.log2}(x)} = \log_2(x) = \text{the unique} \; y \; \text{such that} \; 2^y = x</annotation></semantics></math></p> - -<div>{{EmbedInteractiveExample("pages/js/math-log2.html")}}</div> - -<p class="hidden">Джерело цих інтерактивних прикладів зберігається у репозиторії на GitHub. Якщо ви маєте бажання зробити свій внесок у проект інтерактивних прикладів - будь ласка, зклонуйте репозиторій <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> та пришліть нам pull request.</p> - -<h2 id="Синтаксис">Синтаксис</h2> - -<pre class="syntaxbox"><code>Math.log2(<var>x</var>)</code></pre> - -<h3 id="Аргументи">Аргументи</h3> - -<dl> - <dt><code>x</code></dt> - <dd>Число.</dd> -</dl> - -<h3 id="Результат">Результат</h3> - -<p>Логарифм за основою 2 від даного числа. Якщо значення аргументу від'ємне, функція повертає {{jsxref("NaN")}}.</p> - -<h2 id="Опис">Опис</h2> - -<p>Якщо значення аргументу <code>x</code> менше від 0, результат завжди дорівнює {{jsxref("NaN")}}.</p> - -<p>У зв'язку з тим, що <code>log2()</code> - це статичний метод <code>Math</code>, слід завжди викликати його як <code>Math.log2()</code>, аніж як метод створеного вами об'єкту <code>Math</code> (оскільки <code>Math</code> не являється конструктором).</p> - -<p>Ця фукнція є еквівалентною комбінації методів Math.log(x) / Math.log(2). Для log2(e) використовуйте вбудовану сталу {{jsxref("Math.LOG2E")}}, яка дорівнює 1 / {{jsxref("Math.LN2")}}. </p> - -<h2 id="Приклади">Приклади</h2> - -<h3 id="Застосування_Math.log2()">Застосування <code>Math.log2()</code></h3> - -<pre class="brush: js">Math.log2(3); // 1.584962500721156 -Math.log2(2); // 1 -Math.log2(1); // 0 -Math.log2(0); // -Infinity -Math.log2(-2); // NaN -Math.log2(1024); // 10 -</pre> - -<h2 id="Поліфіл">Поліфіл</h2> - -<p>Даний поліфіл емулює функцію <code>Math.log2</code>. Зауважте, що він повертає неточні значення для деяких аргументів (наприклад, 1 << 29), тому обгорніть його у {{jsxref("Math.round()")}}, якщо працюєте із бітовими масками.</p> - -<pre class="brush: js">Math.log2 = Math.log2 || function(x) { - return Math.log(x) * Math.LOG2E; -}; -</pre> - -<h2 id="Специфікації">Специфікації</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Специфікація</th> - <th scope="col">Статус документу</th> - <th scope="col">Примітка</th> - </tr> - <tr> - <td>{{SpecName('ES2015', '#sec-math.log2', 'Math.log2')}}</td> - <td>{{Spec2('ES2015')}}</td> - <td>Первинне визначення.</td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-math.log2', 'Math.log2')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Підтримка_у_браузерах">Підтримка у браузерах</h2> - -<p class="hidden">Таблиця сумісності на цій сторінці сформована автоматично із структурованих даних. Якщо ви маєте бажання зробити свій внесок до цих даних - будь-ласка, ось репозиторій <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>, надішліть нам свій pull request.</p> - -<p>{{Compat("javascript.builtins.Math.log2")}}</p> - -<h2 id="Дивіться_також">Дивіться також</h2> - -<ul> - <li>{{jsxref("Math.exp()")}}</li> - <li>{{jsxref("Math.log()")}}</li> - <li>{{jsxref("Math.log10()")}}</li> - <li>{{jsxref("Math.log1p()")}}</li> - <li>{{jsxref("Math.pow()")}}</li> -</ul> |
