Number.POSITIVE_INFINITY
JavaScript 1.1+, ECMAScript 1.0+, JScript 1.0+ Nav3+, NES2+, IE 3+, Opera3+ Syntax
Number. POSITIVE_INFINITY
Description
The POSITIVE_INFINITY property of the Number object represents a positive infinity number. It is returned when a calculation returns a positive number greater than the largest number in JavaScript.
Example
Listing 6.186 shows how the POSITIVE_INFINITY property is used.
Listing 6.186 Example of POSITIVE_INFINITY
<html> <body> <script language="JavaScript"> <!–– Hide // Performs some math computation and then checks the // result against the POSITIVE_INFINITY value if((Math.exp(999)) <= Number.POSITIVE_INFINITY_){ document.write("This is less than positive infinity"); } else{ document.write('This ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.