POSITIVE_INFINITY  Number  class propertyS2C Home  « Globals « Number « POSITIVE_INFINITY

Description

Value representing positive infinity which is the same as the positive value of the Infinity global variable.

  • Like all class properties POSITIVE_INFINITY should be used on the class rather than an instance of the class.

Syntax

Signature Description
Number.POSITIVE_INFINITYValue representing positive infinity which is the same as the positive value of the Infinity global variable.

Parameters

None.

Mathematical Rules

Multiplication Rules
POSITIVE_INFINITY*POSITIVE_INFINITY=POSITIVE_INFINITY
POSITIVE_INFINITY*any other positive value=POSITIVE_INFINITY
POSITIVE_INFINITY*NEGATIVE_INFINITY=NEGATIVE_INFINITY
POSITIVE_INFINITY*any other negative value=NEGATIVE_INFINITY
POSITIVE_INFINITY*zero=NaN
POSITIVE_INFINITY*NaN=NaN
Division Rules
POSITIVE_INFINITY/POSITIVE_INFINITY=NaN
POSITIVE_INFINITY/any other positive value=POSITIVE_INFINITY
POSITIVE_INFINITY/NEGATIVE_INFINITY=NaN
POSITIVE_INFINITY/any other negative value=NEGATIVE_INFINITY
any number/NEGATIVE_INFINITY=zero

Examples

The code below displays the above POSITIVE_INFINITY rules.


// Multiplication Rules
var posInfinityMult = new Array(6);
posInfinityMult[0] = Number.POSITIVE_INFINITY * Number.POSITIVE_INFINITY;
posInfinityMult[1] = Number.POSITIVE_INFINITY * Number.MIN_VALUE;
posInfinityMult[2] = Number.POSITIVE_INFINITY * Number.NEGATIVE_INFINITY;
posInfinityMult[3] = Number.POSITIVE_INFINITY * (Number.MIN_VALUE * -1);
posInfinityMult[4] = Number.POSITIVE_INFINITY * 0;
posInfinityMult[5] = Number.POSITIVE_INFINITY * Number.NaN;
alert('Multiplication Results: ' + posInfinityMult);
// Division Rules
var posInfinityDiv = new Array(7);
posInfinityDiv[0] = Number.POSITIVE_INFINITY / Number.POSITIVE_INFINITY;
posInfinityDiv[1] = Number.POSITIVE_INFINITY / Number.MIN_VALUE;
posInfinityDiv[2] = Number.POSITIVE_INFINITY / Number.NEGATIVE_INFINITY;
posInfinityDiv[3] = Number.POSITIVE_INFINITY / (Number.MIN_VALUE * -1);
posInfinityDiv[4] = -1 / Number.POSITIVE_INFINITY;
posInfinityDiv[5] = 0 / Number.POSITIVE_INFINITY;
posInfinityDiv[6] = 1 / Number.POSITIVE_INFINITY;
alert('Division Results: ' + posInfinityDiv);


Press the button below to action the above code:


Related Tutorials

JavaScript Advanced Tutorials - Lesson 3 - Number

go to home page Homepage go to top of page Top