From 187d4eb1e4784a944d28e22371ea08f39b538b27 Mon Sep 17 00:00:00 2001 From: alattalatta Date: Thu, 15 Jul 2021 14:44:07 +0900 Subject: Add/update arithmetic operators (#1329) * Update addition operator * Add subtraction operator * Add division operator * Add multiplication operator * Update remainder operator * Add exponentiation operator * Update operator names * Update link to bitwise XOR operator * Translate "Operator:" of syntax boxes * Sync with English --- .../reference/operators/remainder/index.html | 90 +++++++++++----------- 1 file changed, 46 insertions(+), 44 deletions(-) (limited to 'files/ko/web/javascript/reference/operators/remainder') diff --git a/files/ko/web/javascript/reference/operators/remainder/index.html b/files/ko/web/javascript/reference/operators/remainder/index.html index beeb0033a3..e1a4b20312 100644 --- a/files/ko/web/javascript/reference/operators/remainder/index.html +++ b/files/ko/web/javascript/reference/operators/remainder/index.html @@ -1,73 +1,75 @@ --- -title: 나머지 연산자 (%) +title: 나머지 (%) slug: Web/JavaScript/Reference/Operators/Remainder +tags: +- JavaScript +- Language feature +- Operator +- Reference translation_of: Web/JavaScript/Reference/Operators/Remainder +browser-compat: javascript.operators.remainder ---
{{jsSidebar("Operators")}}
-

나머지 연산자(%)는 피제수가 제수에 의해 나누어진 후, 그 나머지를 반환합니다. 항상 피제수의 부호를 따릅니다.

+

나머지 연산자(%)는 왼쪽 피연산자를 오른쪽 피연산자로 나눴을 때의 나머지를 구합니다. 부호는 항상 왼쪽 피연산자의 부호를 따릅니다.

{{EmbedInteractiveExample("pages/js/expressions-remainder.html")}}
-
+

구문

+
x % y
+

예제

-

문법

+

양의 피제수의 나머지

-
Operator: var1 % var2
+
+ 12 % 5  //  2
+  1 % -2 //  1
+  1 % 2  //  1
+  2 % 3  //  2
+5.5 % 2  // 1.5
 
-

예시

+

음의 피제수의 나머지

-

(+)피제수의 나머지

- -
 12 % 5  //  2
- 1 % -2 //  1
- 1 % 2  //  1
- 2 % 3  //  2
-5.5 % 2 // 1.5
-
- -

(-)피제수의 나머지

- -
-12 % 5 // -2
+
+-12 % 5 // -2
 -1 % 2  // -1
--4 % 2  // -0
+-4 % 2 // -0 +
-

NaN의 나머지

+

NaN의 나머지

-
NaN % 2 // NaN
+
NaN % 2 // NaN
-

Specifications

+

Infinity의 나머지

- - - - - - - - - -
Specification
{{SpecName('ESDraft', '#sec-multiplicative-operators', 'Remainder operator')}}
+
+Infinity % 2 // NaN
+Infinity % 0 // NaN
+Infinity % Infinity // NaN
+
-

Browser compatibility

+

명세

+{{Specifications}} +

브라우저 호환성

-

{{Compat("javascript.operators.remainder")}}

+

{{Compat}}

-

See also

+

같이 보기

-- cgit v1.2.3-54-g00ecf