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

JavaScript NEGATIVE_INFINITY Property

 JavaScript Number Object

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;
Test and see‹/›

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 multiplied by NEGATIVE_INFINITY is NaN

  • NEGATIVE_INFINITY divided by any negative value other than NEGATIVE_INFINITY is POSITIVE_INFINITY

  • NEGATIVE_INFINITY divided by any positive value other than POSITIVE_INFINITY is NEGATIVE_INFINITY

  • NEGATIVE_INFINITY divided by NEGATIVE_INFINITY or POSITIVE_INFINITY results in NaN

Browser Compatibility

All browsers fully support the NEGATIVE_INFINITY property:

Properties
NEGATIVE_INFINITYYesYesYesYesYes

Technical Details

Writable:None
Enumerable:None
Configurable:None
Return Value:-Infinity
JavaScript Version:ECMAScript 1

More Examples

Returns NEGATIVE_INFINITY when overflow occurs:

var num = -5 / 0;
Test and see‹/›

 JavaScript Number Object