English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
POSITIVE_INFINITYla propiedad representa el valor infinito positivo.
El valor de Number.POSITIVE_INFINITY es el mismo que el del objeto globalInfinitylos valores de las propiedades son idénticos.
Debido a que POSITIVE_INFINITY es una propiedad estática de Number, siempre utilícela comoNumber.POSITIVE_INFINITYen lugar de usarlo como propiedad del objeto Number creado.
Number.POSITIVE_INFINITY
Number.POSITIVE_INFINITY;Prueba para ver‹/›
El comportamiento del valor de retorno es ligeramente diferente del infinito matemático:
Cualquier valor positivo (incluyendo POSITIVE_INFINITY) multiplicado por POSITIVE_INFINITY es POSITIVE_INFINITY
Cualquier valor negativo (incluyendo NEGATIVE_INFINITY) multiplicado por POSITIVE_INFINITY es NEGATIVE_INFINITY
Cualquier número positivo dividido por POSITIVE_INFINITY es cero positivo
Cualquier número negativo dividido por POSITIVE_INFINITY es cero negativo
Cero multiplicado por POSITIVE_INFINITY es NaN
NaN multiplicado por POSITIVE_INFINITY da NaN
POSITIVE_INFINITY dividido por cualquier valor negativo fuera de NEGATIVE_INFINITY es NEGATIVE_INFINITY
POSITIVE_INFINITY dividido por cualquier valor positivo fuera de POSITIVE_INFINITY es POSITIVE_INFINITY
POSITIVE_INFINITY dividido por NEGATIVE_INFINITY o POSITIVE_INFINITY da NaN
Todos los navegadores admiten completamente el atributo POSITIVE_INFINITY:
Atributo | |||||
POSITIVE_INFINITY | Sí | Sí | Sí | Sí | Sí |
Escritura: | No |
---|---|
Enumerable: | No |
Configurable: | No |
Valor de retorno: | Infinity |
Versión de JavaScript: | ECMAScript 1 |
Al sobrepasar el límite, regresa POSITIVE_INFINITY:
var num = 5 / 0;Prueba para ver‹/›