221k views
2 votes
If a numerical operation returns a number greater than the largest possible JavaScript value, it returns

NaN

-NaN

Infinity

-Infinity

1 Answer

4 votes

Answer:

Infinity

Step-by-step explanation:

If a numerical operation returns a number greater than the largest possible javascript value, it returns Infinity (POSITIVE_INFINITY for positive values).

The largest possible value that can be handled by javascript can be determined using the following code segment:

<script>

var x = Number.MAX_VALUE;

alert(x);

</script>

This returns a value 1.7976931348623157e+308 . So if the result of a numerical operation is larger than this, Infinity is returned.

User Estragon
by
5.9k points