aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/global_objects/math/trunc/index.html
diff options
context:
space:
mode:
authorJongha Kim <kim.jongha@gmail.com>2021-07-04 21:44:14 +0900
committerGitHub <noreply@github.com>2021-07-04 21:44:14 +0900
commit7819d811c4afda0780bdfb8f453cf6f367203ccd (patch)
treecdc07e253c6d5908bc8d0bb99a02bfb943b2ac12 /files/ko/web/javascript/reference/global_objects/math/trunc/index.html
parent5b86e40da30a9db006a06cb1deb703d1bd08b03c (diff)
downloadtranslated-content-7819d811c4afda0780bdfb8f453cf6f367203ccd.tar.gz
translated-content-7819d811c4afda0780bdfb8f453cf6f367203ccd.tar.bz2
translated-content-7819d811c4afda0780bdfb8f453cf6f367203ccd.zip
[ko] fix Javascript Math.tan(), Math.trunc() (#1302)
* Javascript Math.tan(), Math.trunc() en-us와 동기화 * 리뷰 사항 반영
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/math/trunc/index.html')
-rw-r--r--files/ko/web/javascript/reference/global_objects/math/trunc/index.html79
1 files changed, 32 insertions, 47 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/math/trunc/index.html b/files/ko/web/javascript/reference/global_objects/math/trunc/index.html
index 93375f989f..6bfddf003e 100644
--- a/files/ko/web/javascript/reference/global_objects/math/trunc/index.html
+++ b/files/ko/web/javascript/reference/global_objects/math/trunc/index.html
@@ -2,38 +2,53 @@
title: Math.trunc()
slug: Web/JavaScript/Reference/Global_Objects/Math/trunc
translation_of: Web/JavaScript/Reference/Global_Objects/Math/trunc
+tags:
+- ECMAScript 2015
+- JavaScript
+- Math
+- Method
+- Reference
+- Polyfill
+browser-compat: javascript.builtins.Math.trunc
---
<div>{{JSRef}}</div>
<p><strong><code>Math.trunc()</code></strong> 함수는 주어진 값의 소수부분을 제거하고 숫자의 정수부분을 반환합니다.</p>
-<h2 id="Syntax">Syntax</h2>
+<div>{{EmbedInteractiveExample("pages/js/math-trunc.html")}}</div>
+
+<h2 id="Syntax">구문</h2>
<pre class="syntaxbox">Math.trunc(<var>x</var>)
</pre>
-<h3 id="Parameters">Parameters</h3>
+<h3 id="Parameters">매개변수</h3>
<dl>
<dt><code>x</code></dt>
- <dd>숫자형</dd>
+ <dd>숫자</dd>
</dl>
-<h3 id="Return_value">Return value</h3>
+<h3 id="Return_value">반환 값</h3>
<p>주어진 숫자의 정수부분</p>
-<h2 id="Description">Description</h2>
+<h2 id="Description">설명</h2>
-<p>Math의 유사함수 3개 : {{jsxref("Math.floor()")}}, {{jsxref("Math.ceil()")}} and {{jsxref("Math.round()")}} 와는 다르게, <code>Math.trunc()</code> 함수는 주어진 값이 양수이건 음수이건 상관없이 소수점 이하 우측부분을 제거하는 매우 단순한 동작을 합니다.</p>
+<p><code>Math</code>의 다른 함수 3개 {{jsxref("Math.floor()")}},
+ {{jsxref("Math.ceil()")}} 그리고 {{jsxref("Math.round()")}} 와는 다르게,
+ <code>Math.trunc()</code> 단순하게 동작합니다. 함수는 주어진 값이 양수이건 음수이건 상관없이
+ 소수점 이하 우측부분을 <em>제거</em>하는 매우 단순한 동작을 합니다.</p>
-<p>함수인자는 암묵적으로 number형으로 변환되어 메소드에 전달됩니다.</p>
+<p>함수인자는 암묵적으로 숫자로 변환되어 메서드에 전달됩니다.</p>
-<p><code>trunc()</code> 함수는 Math의 정적 메소드이기 때문에 사용자가 생성한 <code>Math</code> 객체의 메소드로 호출하는 것이 아닌 항상 <code>Math.trunc()</code> 형태로 호출해야 합니다. (<code>Math</code> 는 생성자가 아닙니다).</p>
+<p><code>trunc()</code> 함수는 <code>Math</code>의 정적 메서드이기 때문에 사용자가 생성한 
+ <code>Math</code> 객체의 메서드로 호출하는 것이 아닌 항상 <code>Math.trunc()</code> 형태로
+ 호출해야 합니다. (<code>Math</code> 는 생성자가 아닙니다).</p>
-<h2 id="Examples">Examples</h2>
+<h2 id="Examples">예제</h2>
-<h3 id="Using_Math.trunc()">Using <code>Math.trunc()</code></h3>
+<h3 id="Using_Math.trunc()"><code>Math.trunc()</code>사용하기</h3>
<pre class="brush: js">Math.trunc(13.37); // 13
Math.trunc(42.84); // 42
@@ -45,43 +60,13 @@ Math.trunc('foo'); // NaN
Math.trunc(); // NaN
</pre>
-<h2 id="Polyfill">Polyfill</h2>
-
-<pre class="brush: js">Math.trunc = Math.trunc || function(x) {
- if (isNaN(x)) {
- return NaN;
- }
- if (x &gt; 0) {
- return Math.floor(x);
- }
- return Math.ceil(x);
-};</pre>
-
-<h2 id="Specifications">Specifications</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('ES2015', '#sec-math.trunc', 'Math.trunc')}}</td>
- <td>{{Spec2('ES2015')}}</td>
- <td>Initial definition.</td>
- </tr>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-math.trunc', 'Math.trunc')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td> </td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility">Browser compatibility</h2>
-
-<p>{{Compat("javascript.builtins.Math.trunc")}}</p>
+<h2 id="Specifications">표준</h2>
+
+{{Specifications}}
+
+<h2 id="Browser_compatibility">브라우저 호환성</h2>
+
+<p>{{Compat}}</p>
<h2 id="See_also">See also</h2>