English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript NEGATIVE_INFINITY property

 Objeto Number do JavaScript

NEGATIVE_INFINITYproperty of the global object, representing the negative infinity value.

The value of Number.NEGATIVE_INFINITY is the same as theInfinityThe negative value of the property is the same.

Because NEGATIVE_INFINITY is a static property of Number, you should always use it asNumber.NEGATIVE_INFINITYbut not as the attribute of the created Number object.

Syntax:

Number.NEGATIVE_INFINITY
Number.NEGATIVE_INFINITY;
Teste e Veja‹/›

The behavior of the return value is slightly different from mathematical infinity:

  • Any positive value (including POSITIVE_INFINITY) multiplied by NEGATIVE_INFINITY results in NEGATIVE_INFINITY

  • Any negative value (including NEGATIVE_INFINITY) multiplied by NEGATIVE_INFINITY results in POSITIVE_INFINITY

  • Any positive value divided by NEGATIVE_INFINITY results in negative zero

  • Any negative value divided by NEGATIVE_INFINITY results in positive zero

  • Zero multiplied by NEGATIVE_INFINITY results in NaN

  • NaN multiplicado por NEGATIVE_INFINITY é NaN

  • Dividir qualquer valor negativo além de NEGATIVE_INFINITY resulta em POSITIVE_INFINITY

  • NEGATIVE_INFINITY dividido por qualquer valor positivo além de POSITIVE_INFINITY é NEGATIVE_INFINITY

  • Dividir por NEGATIVE_INFINITY ou POSITIVE_INFINITY resulta em NaN

Compatibilidade de Navegador

Todos os navegadores suportam completamente o atributo NEGATIVE_INFINITY:

Atributo
NEGATIVE_INFINITYSimSimSimSimSim

Detalhes Técnicos

Escrita:Nenhum
Enumerável:Nenhum
Configurável:Nenhum
Retorno:-Infinity
Versão do JavaScript:ECMAScript 1

Mais Exemplos

Retorna NEGATIVE_INFINITY ao exceder o limite:

var num = -5 / 0;
Teste e Veja‹/›

 Objeto Number do JavaScript