English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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
All browsers fully support the NEGATIVE_INFINITY property:
Properties | |||||
NEGATIVE_INFINITY | Yes | Yes | Yes | Yes | Yes |
Writable: | None |
---|---|
Enumerable: | None |
Configurable: | None |
Return Value: | -Infinity |
JavaScript Version: | ECMAScript 1 |
Returns NEGATIVE_INFINITY when overflow occurs:
var num = -5 / 0;Test and see‹/›