From cb9e359a51c3249d8f5157db69d43fd413ddeda6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:45:12 +0100 Subject: unslug ca: move --- .../number/negative_infinity/index.html | 134 +++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/number/negative_infinity/index.html (limited to 'files/ca/web/javascript/reference/global_objects/number/negative_infinity') diff --git a/files/ca/web/javascript/reference/global_objects/number/negative_infinity/index.html b/files/ca/web/javascript/reference/global_objects/number/negative_infinity/index.html new file mode 100644 index 0000000000..3fb4c1d150 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/number/negative_infinity/index.html @@ -0,0 +1,134 @@ +--- +title: Number.NEGATIVE_INFINITY +slug: Web/JavaScript/Referencia/Objectes_globals/Number/NEGATIVE_INFINITY +translation_of: Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY +--- +
{{JSRef("Global_Objects", "Number")}}
+ +

Resum

+ +

La propietat Number.NEGATIVE_INFINITY representa el valor infinit negatiu.

+ +

No fa falta crear un objecte {{jsxref("Global_Objects/Number", "Number")}} per accedir a aquesta propietat estàtica (feu servir Number.NEGATIVE_INFINITY).

+ +
{{js_property_attributes(0, 0, 0)}}
+ +

Descripció

+ +

El valor de Number.NEGATIVE_INFINITY és el mateix que el valor negatiu de la propietat de l'objecte global {{jsxref("Global_Objects/Infinity", "Infinity")}}.

+ +

Aquest valor es comporta de forma una mica diferent a l'infinit matemàtic:

+ + + +

Es pot fer serivir la propietat Number.NEGATIVE_INFINITY per indicar una condició d'error que retorna un nombre finit en cas d'èxit. Fixeu-vos, però, que {{jsxref("Global_Objects/isFinite", "isFinite")}} seria més apropiat en aquest cas.

+ +

Exemples

+ +

Exemple: Fer servir NEGATIVE_INFINITY

+ +

En l'exemple següent, a la variable smallNumber se li assigna un valor que és més petit que el valor mínim. Quan la delcaració {{jsxref("Statements/if...else", "if")}} s'executa, smallNumber té el valor -Infinity, així smallNumber s'estableix com a un valor més manegable abans de prosseguir.

+ +
var smallNumber = (-Number.MAX_VALUE) * 2;
+
+if (smallNumber == Number.NEGATIVE_INFINITY) {
+  smallNumber = returnFinite();
+}
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
1a edició de ECMAScript.EstàndardDefinició inicial. Implementat en JavaScript 1.1.
{{SpecName('ES5.1', '#sec-15.7.3.5', 'Number.NEGATIVE_INFINITY')}}{{Spec2('ES5.1')}}
{{SpecName('ES6', '#sec-number.negative_infinity', 'Number.NEGATIVE_INFINITY')}}{{Spec2('ES6')}}
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

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