From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../referencje/obiekty/number/epsilon/index.html | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 files/pl/web/javascript/referencje/obiekty/number/epsilon/index.html (limited to 'files/pl/web/javascript/referencje/obiekty/number/epsilon') diff --git a/files/pl/web/javascript/referencje/obiekty/number/epsilon/index.html b/files/pl/web/javascript/referencje/obiekty/number/epsilon/index.html new file mode 100644 index 0000000000..289e33ad79 --- /dev/null +++ b/files/pl/web/javascript/referencje/obiekty/number/epsilon/index.html @@ -0,0 +1,76 @@ +--- +title: Number.EPSILON +slug: Web/JavaScript/Referencje/Obiekty/Number/EPSILON +tags: + - ECMAScript 2015 + - JavaScript + - Number + - Właściwość +translation_of: Web/JavaScript/Reference/Global_Objects/Number/EPSILON +--- +
{{JSRef}}
+ +

Właściwość Number.EPSILON reprezentuje różnicę pomiędzy 1 a najmniejszą liczbą zmiennoprzecinkową większą niż 1.

+ +

Jest to właściwość statyczna. Nie musisz tworzyć obiektu {{jsxref("Number")}}, żeby mieć do niej dostęp (użyj Number.EPSILON).

+ +
{{EmbedInteractiveExample("pages/js/number-epsilon.html")}}
+ + + +
{{js_property_attributes(0, 0, 0)}}
+ +

Opis

+ +

Wartość właściwości EPSILON to w przybliżeniu  2.2204460492503130808472633361816E-16 lub 2-52.

+ +

Przykłady

+ +

Testowanie równości

+ +
x = 0.2;
+y = 0.3;
+z = 0.1;
+equal = (Math.abs(x - y + z) < Number.EPSILON);
+
+ +

Polyfill

+ +
if (Number.EPSILON === undefined) {
+    Number.EPSILON = Math.pow(2, -52);
+}
+
+ +

Specyfikacja

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('ES2015', '#sec-number.epsilon', 'Number.EPSILON')}}{{Spec2('ES2015')}}Initial definition.
{{SpecName('ESDraft', '#sec-number.epsilon', 'Number.EPSILON')}}{{Spec2('ESDraft')}}
+ +

Kompatybilność

+ + + +

{{Compat("javascript.builtins.Number.EPSILON")}}

+ +

Zobacz również

+ + -- cgit v1.2.3-54-g00ecf