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

JavaScript POSITIVE_INFINITY attribute

 Objet Number JavaScript

POSITIVE_INFINITYattribute represents the positive infinity value.

The value of Number.POSITIVE_INFINITY is the same as the global object'sInfinityhave the same value.

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.

Syntax:

Number.POSITIVE_INFINITY
Number.POSITIVE_INFINITY;
Vérifier le‹/›

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

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

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

  • Any positive number divided by POSITIVE_INFINITY is positive zero

  • Any negative number divided by POSITIVE_INFINITY is negative zero

  • Zero times POSITIVE_INFINITY is NaN

  • NaN multiplié par POSITIVE_INFINITY donne NaN

  • POSITIVE_INFINITY divisé par tout autre nombre négatif que NEGATIVE_INFINITY donne NEGATIVE_INFINITY

  • POSITIVE_INFINITY divisé par tout autre nombre positif que POSITIVE_INFINITY donne POSITIVE_INFINITY

  • POSITIVE_INFINITY divisé par NEGATIVE_INFINITY ou POSITIVE_INFINITY donne NaN

Compatibilité navigateur

POSITIVE_INFINITY est complètement supporté par tous les navigateurs :

Propriétés
POSITIVE_INFINITYOuiOuiOuiOuiOui

Détails techniques

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

Plus d'exemples

Retourne POSITIVE_INFINITY lors d'un débordement :

var num = 5 / 0;
Vérifier le‹/›

 Objet Number JavaScript