--- title: Number.EPSILON slug: Web/JavaScript/Reference/Global_Objects/Number/EPSILON tags: - ECMAScript6 - JavaScript - Number - 속성 translation_of: Web/JavaScript/Reference/Global_Objects/Number/EPSILON ---
Number.EPSILON
속성(property)은 {{jsxref("Number")}} 형으로 표현될 수 있는 1과 1보다 큰 값 중에서 가장 작은 값의, 차입니다.
당신은 이 정적 속성에 접근하기 위하여 {{jsxref("Number")}} 객체를 생성할 필요가 없습니다. Number.EPSILON
을 쓰면 됩니다.
이 EPSILON
속성은 대략 2.2204460492503130808472633361816E-16
또는 2-52
의 값을 갖습니다.
const x = 0.2, y = 0.3, z = 0.1; let equal = (Math.abs(x - y + z) < Number.EPSILON);
명세 | 상태 | 비고 |
---|---|---|
{{SpecName('ES6', '#sec-number.epsilon', 'Number.EPSILON')}} | {{Spec2('ES6')}} | 최초로 정의됨. |
{{SpecName('ESDraft', '#sec-number.epsilon', 'Number.EPSILON')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.Number.EPSILON")}}