English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
POSITIVE_INFINITYattribute represents the value of positive infinity.
The value of Number.POSITIVE_INFINITY is the same as the global object'sInfinityvalues are the same.
Because POSITIVE_INFINITY is a static property of Number, you should always use it asNumber.POSITIVE_INFINITYbut not as the attribute of the created Number object.
Number.POSITIVE_INFINITY
Number.POSITIVE_INFINITY;Teste e Veja‹/›
The behavior of the return value is slightly different from mathematical infinity:
Any positive value (including POSITIVE_INFINITY) multiplied by POSITIVE_INFINITY results in POSITIVE_INFINITY
Any negative value (including NEGATIVE_INFINITY) multiplied by POSITIVE_INFINITY results in NEGATIVE_INFINITY
Any positive number divided by POSITIVE_INFINITY results in positive zero
Any negative number divided by POSITIVE_INFINITY results in negative zero
Zero multiplied by POSITIVE_INFINITY results in NaN
NaN multiplicado por POSITIVE_INFINITY resulta em NaN
POSITIVE_INFINITY dividido por qualquer valor negativo além de NEGATIVE_INFINITY resulta em NEGATIVE_INFINITY
POSITIVE_INFINITY dividido por qualquer valor positivo além de POSITIVE_INFINITY resulta em POSITIVE_INFINITY
POSITIVE_INFINITY dividido por NEGATIVE_INFINITY ou POSITIVE_INFINITY resulta em NaN
Todos os navegadores suportam completamente a propriedade POSITIVE_INFINITY:
Atributos | |||||
POSITIVE_INFINITY | Sim | Sim | Sim | Sim | Sim |
Escrita: | Nenhum |
---|---|
Enumerável: | Nenhum |
Configurável: | Nenhum |
Retorno: | Infinity |
Versão do JavaScript: | ECMAScript 1 |
Retorna POSITIVE_INFINITY ao exceder o limite:
var num = 5 / 0;Teste e Veja‹/›