diff options
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/math/log/index.html')
-rw-r--r-- | files/ko/web/javascript/reference/global_objects/math/log/index.html | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/math/log/index.html b/files/ko/web/javascript/reference/global_objects/math/log/index.html new file mode 100644 index 0000000000..a343fa27a6 --- /dev/null +++ b/files/ko/web/javascript/reference/global_objects/math/log/index.html @@ -0,0 +1,104 @@ +--- +title: Math.log() +slug: Web/JavaScript/Reference/Global_Objects/Math/log +translation_of: Web/JavaScript/Reference/Global_Objects/Math/log +--- +<div>{{JSRef}}</div> + +<p><strong><code>Math.log()</code></strong> 함수는 자연 로가리즘은 ({{jsxref("Math.E", "e")}} 를 기초) 의 수를 계산합니다, 이건 다음의</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.log</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle><mo>=</mo><mo lspace="0em" rspace="0em">ln</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mtext>the unique</mtext><mspace width="thickmathspace"></mspace><mi>y</mi><mspace width="thickmathspace"></mspace><mtext>such that</mtext><mspace width="thickmathspace"></mspace><msup><mi>e</mi><mi>y</mi></msup><mo>=</mo><mi>x</mi></mrow><annotation encoding="TeX">\forall x > 0, \mathtt{\operatorname{Math.log}(x)} = \ln(x) = \text{고유값} \; y \; \text{같이} \; e^y = x</annotation></semantics></math></p> + +<p>자바스크립트 <strong><code>Math.log()</code> </strong>함수는 <em>ln(x)</em> 수학적으로 같습니다.</p> + +<h2 id="문법">문법</h2> + +<pre class="syntaxbox"><code>Math.log(<var>x</var>)</code></pre> + +<h3 id="인자">인자</h3> + +<dl> + <dt><code>x</code></dt> + <dd>실수값.</dd> +</dl> + +<h3 id="반환값">반환값</h3> + +<p>자연 로가리즘은 ({{jsxref("Math.E", "e")}} 를 기초) 실수값으로 줍니다. 마이너스 실수값, {{jsxref("NaN")}} 계산됩니다.</p> + +<h2 id="설명">설명</h2> + +<p>만일 값 <code>x</code> 가 마이너스라면, 항상 다음값이 계산됩니다 {{jsxref("NaN")}}.</p> + +<p><code>왜그렇냐면 </code> <code>Math의 log() 가 정적 메서드이기 때문</code>,에 매번 다음처럼 <code>Math.log() 써야합니다</code> (생성자로 초기화된 <code>Math</code> 개체가 아니기 때문입니다).</p> + +<p>자연로그 2 나 10, 상수로쓸때 {{jsxref("Math.LN2")}} or {{jsxref("Math.LN10")}} . 로가리즘 기초값 2 나 10, 쓸때는 {{jsxref("Math.log2()")}} 혹은 {{jsxref("Math.log10()")}} . 로가리즘 다른 기초값은 Math.log(x) / Math.log(기초값) 처럼 예제참고; 미리계산하여 1 / Math.log(기초값) 할 수 있습니다.</p> + +<h2 id="예제">예제</h2> + +<h3 id="Math.log()_사용"><code>Math.log() 사용</code></h3> + +<pre class="brush: js">Math.log(-1); // NaN, 정의범위 초과 +Math.log(0); // -Infinity, 무한 +Math.log(1); // 0 +Math.log(10); // 2.302585092994046 +</pre> + +<h3 id="Math.log()_다른_기초값_사용"><code>Math.log()</code> 다른 기초값 사용</h3> + +<p>이 함수는 로가리즘 <code>y 에 대한것으로</code> 기초값 <code>x</code> (ie. <math><semantics><mrow><msub><mo>log</mo><mi>x</mi></msub><mi>y</mi></mrow><annotation encoding="TeX">\log_x y</annotation></semantics></math>): 입니다</p> + +<pre class="brush: js">function getBaseLog(x, y) { + return Math.log(y) / Math.log(x); +} +</pre> + +<p>다음을 실행하면 <code>getBaseLog(10, 1000)</code> 다음 <code>2.9999999999999996 계산되는데</code> 적당히 반올림하니다, 거의 3 에 가깝습니다.</p> + +<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('ES1')}}</td> + <td>{{Spec2('ES1')}}</td> + <td>Initial definition. Implemented in JavaScript 1.0.</td> + </tr> + <tr> + <td>{{SpecName('ES5.1', '#sec-15.8.2.10', 'Math.log')}}</td> + <td>{{Spec2('ES5.1')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('ES6', '#sec-math.log', 'Math.log')}}</td> + <td>{{Spec2('ES6')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-math.log', 'Math.log')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="브라우저_호환성">브라우저 호환성</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("javascript.builtins.Math.log")}}</p> + +<h2 id="같이보기">같이보기</h2> + +<ul> + <li>{{jsxref("Math.exp()")}}</li> + <li>{{jsxref("Math.log1p()")}}</li> + <li>{{jsxref("Math.log10()")}}</li> + <li>{{jsxref("Math.log2()")}}</li> + <li>{{jsxref("Math.pow()")}}</li> +</ul> |