Global Infinity Property - Javascript Global

Javascript examples for Global:Infinity Property

Description

Infinity is a numeric value that represents positive infinity, -Infinity is a numeric value that represents negative infinity.

The following code shows how to Display a number that exceeds the limit of a floating point number:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//from w  w  w .  j  a v  a2 s  . c o  m
    document.getElementById("demo").innerHTML = 1.7976931348623157E+10308 + "<br>" +  -1.7976931348623157E+10308;
}
</script>

</body>
</html>

Related Tutorials