Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020년 9월.
BigInt.asUintN() 정적 메서드는 BigInt 값을 주어진 최하위 비트 수로 자르고 해당 값을 부호 없는 정수로 반환합니다.
반환된 BigInt에 사용할 수 있는 비트의 양입니다. 0에서 253 - 1 이하의 정수여야 합니다.
bigint제공된 비트에 맞게 잘라낼 BigInt 값입니다.
부호 없는 정수인, bigint와 2^bits의 나머지 연산 값입니다.
bits가 음수이거나 253 - 1 보다 크면 발생합니다.
BigInt.asUintN 메서드는 BigInt 값을 주어진 비트 수로 잘라내고 그 결과를 부호 없는 정수로 해석합니다. 부호가 없는 정수는 부호 비트가 없으며 언제나 음수가 아닙니다. 예를 들어, BigInt.asUintN(4, 25n)의 경우 25n 값은 9n으로 잘립니다.
25n = 00011001 (이진수) ^==== 오직 남은 4개의 비트만 사용 ===> 1001 (이진수) = 9n참고 : BigInt 값은 언제나 이진수 2의 보수로 인코딩됩니다.
Number.prototype.toExponential()와 같은 유사한 언어 API와 달리 asUintN은 BigInt의 정적 속성이므로 항상 BigInt 값의 메서드가 아닌 BigInt.asUintN()으로 사용합니다. asUintN()을 "표준 라이브러리 함수"로 노출하면 asm.js와의 상호 운용을 할 수 있습니다.
64비트 연산 범위를 유지하는 데 BigInt.asUintN() 메서드가 유용할 수 있습니다.
| ECMAScript® 2027 Language Specification # sec-bigint.asuintn |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 10월 9일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.