NEGATIVE_INFINITY
Number
prop
JS Home <<
JS Reference <<
Number <<
NEGATIVE_INFINITY
Description
Value representing negative infinity which is the same as the negative value of the Infinity
global variable.
- Like all class properties
NEGATIVE_INFINITY
should be used on the class rather than an instance of the class.
Syntax
Signature | Description |
---|---|
Number.NEGATIVE_INFINITY | Value representing negative infinity which is the same as the negative value of the Infinity global variable. |
Parameters
None.
Mathematical Rules
Multiplication Rules | ||||
NEGATIVE_INFINITY | * | POSITIVE_INFINITY | = | NEGATIVE_INFINITY |
NEGATIVE_INFINITY | * | any other positive value | = | NEGATIVE_INFINITY |
NEGATIVE_INFINITY | * | NEGATIVE_INFINITY | = | POSITIVE_INFINITY |
NEGATIVE_INFINITY | * | any other negative value | = | POSITIVE_INFINITY |
NEGATIVE_INFINITY | * | zero | = | NaN |
NEGATIVE_INFINITY | * | NaN | = | NaN |
Division Rules | ||||
NEGATIVE_INFINITY | / | NEGATIVE_INFINITY | = | NaN |
NEGATIVE_INFINITY | / | any other negative value | = | POSITIVE_INFINITY |
NEGATIVE_INFINITY | / | POSITIVE_INFINITY | = | NaN |
NEGATIVE_INFINITY | / | any other positive value | = | NEGATIVE_INFINITY |
any number | / | NEGATIVE_INFINITY | = | zero |
Examples
The code below displays the above NEGATIVE_INFINITY
rules.
// Multiplication Rules
var negInfinityMult = new Array(6);
negInfinityMult[0] = Number.NEGATIVE_INFINITY * Number.POSITIVE_INFINITY;
negInfinityMult[1] = Number.NEGATIVE_INFINITY * Number.MIN_VALUE;
negInfinityMult[2] = Number.NEGATIVE_INFINITY * Number.NEGATIVE_INFINITY;
negInfinityMult[3] = Number.NEGATIVE_INFINITY * (Number.MIN_VALUE * -1);
negInfinityMult[4] = Number.NEGATIVE_INFINITY * 0;
negInfinityMult[5] = Number.NEGATIVE_INFINITY * Number.NaN;
alert('Multiplication Results: ' + negInfinityMult);
// Division Rules
var negInfinityDiv = new Array(7);
negInfinityDiv[0] = Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY;
negInfinityDiv[1] = Number.NEGATIVE_INFINITY / (Number.MIN_VALUE * -1);
negInfinityDiv[2] = Number.NEGATIVE_INFINITY / Number.POSITIVE_INFINITY;
negInfinityDiv[3] = Number.NEGATIVE_INFINITY / Number.MIN_VALUE;
negInfinityDiv[4] = -1 / Number.NEGATIVE_INFINITY;
negInfinityDiv[5] = 0 / Number.NEGATIVE_INFINITY;
negInfinityDiv[6] = 1 / Number.NEGATIVE_INFINITY;
alert('Division Results: ' + negInfinityDiv);
Related Tutorials
JavaScript Advanced Tutorials - Lesson 3 - Number