A number that is larger than the largest floating point number.
SyntaxInfinity
Return Value
Returns an initial value of Number.POSITIVE_INFINITY.
ExamplesDivisions by zero will give you Infinity. Divisions by negative zero will give you -Infinity.
42 / 0;
42 / 0;
Everything beyond Infinity remains Infinity
Infinity * Infinity;
If an arithmetic overflow occurs, Infinity is also returned
Math.pow(2, 1024);
Remarks
The Infinity constant is a member of the Global object, and is made available when the scripting engine is initialized.
Notes Negative InfinityNegative Infinity (-Infinity) is smaller than the smallest floating point number and returns a value of Number.NEGATIVE_INFINITY.
MathematicalThis value behaves mathematically like infinity; for example, anything multiplied by Infinity is Infinity, and anything divided by Infinity is 0.
Infinity subtracted by Infinity will return NaN
isFinite()The isFinite() function can be used to check if a given value is a finite number
See also Other articles AttributionsMicrosoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4