You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!
Resum
La propietat Number.EPSILON
representa la diferència entre el nombre 1 i el valor més petit major que 1 que pot ser representat com un Number
.
Per tal d'accedir a la propietat no es fa necessari crear un objecte Number
ja que és una propietat estàtica i n'hi ha prou amb fer servir Number.EPSILON
per a obtindre el valor.
Property attributes of Number.EPSILON |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
Descripció
La propietat EPSILON
té un valor aproximat de 2.2204460492503130808472633361816E-16
, és a dir, 2-52
.
Exemples
Exemple: Comprovant l'igualtat
x = 0.2; y = 0.3; equal = (Math.abs(x - y) < Number.EPSILON);
Especificacions
Especificació | Estat | Comentaris |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Number.EPSILON' in that specification. |
Standard | Definició inicial |
Compatibilitat amb navegadors
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Suport bàsic | (Yes) | 25.0 (25.0) | No support | (Yes) | No support |
Característica | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Suport bàsic | No support | No support | 25.0 (25.0) | No support | No support | No support |
Vegeu també
- L'objecte
Number
al qual pertany.