A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Remainder below:

나머지 (%) - JavaScript | MDN

나머지 (%)

Baseline Widely available

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

시도해 보기
console.log(13 % 5);
// Expected output: 3

console.log(-13 % 5);
// Expected output: -3

console.log(4 % 2);
// Expected output: 0

console.log(-4 % 2);
// Expected output: -0
구문 예제 양의 피제수의 나머지
12 % 5; //  2
1 % -2; //  1
1 % 2; //  1
2 % 3; //  2
5.5 % 2; // 1.5
음의 피제수의 나머지
(-12 % 5) - // -2
  (1 % 2) - // -1
  (4 % 2); // -0
NaN의 나머지 Infinity의 나머지
Infinity % 2; // NaN
Infinity % 0; // NaN
Infinity % Infinity; // NaN
명세 브라우저 호환성 같이 보기

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4