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

JavaScript NEGATIVE_INFINITY property

 Objet Number JavaScript

NEGATIVE_INFINITYProperty represents the negative infinity value.

The value of Number.NEGATIVE_INFINITY is the same as the global object'sInfinityThe negative value of the property is the same.

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

Syntax:

Number.NEGATIVE_INFINITY
Number.NEGATIVE_INFINITY;
Testez et voyez‹/›

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

  • Any positive value (including POSITIVE_INFINITY) multiplied by NEGATIVE_INFINITY is NEGATIVE_INFINITY

  • Any negative value (including NEGATIVE_INFINITY) multiplied by NEGATIVE_INFINITY is POSITIVE_INFINITY

  • Any positive value divided by NEGATIVE_INFINITY is negative zero

  • Any negative value divided by NEGATIVE_INFINITY is positive zero

  • Zero multiplied by NEGATIVE_INFINITY is NaN

  • NaN multiplié par NEGATIVE_INFINITY donne NaN

  • Diviser tout autre nombre négatif par NEGATIVE_INFINITY donne POSITIVE_INFINITY

  • NEGATIVE_INFINITY divisé par tout autre nombre positif, donne NEGATIVE_INFINITY

  • Diviser par NEGATIVE_INFINITY ou POSITIVE_INFINITY donne NaN

Compatibilité navigateur

Tous les navigateurs supportent intégralement la propriété NEGATIVE_INFINITY :

Propriété
NEGATIVE_INFINITYOuiOuiOuiOuiOui

Détails techniques

Écrivable :Non
Enumerable :Non
Configurable :Non
Valeur de retour :-Infinity
Version JavaScript :ECMAScript 1

Plus d'exemples

Retourne NEGATIVE_INFINITY lors du débordement :

var num = -5 / 0;
Testez et voyez‹/›

 Objet Number JavaScript