Infinity

Try it yourself:


Infinity: an unbounded value

Infinity represents an unbounded positive value in calculations. It is useful for limits and sentinel values, but it is not an ordinary finite number.

Safe handling

Use isFinite() to reject it from ordinary totals, and isBounded() when validating ranges. max() and min() may legitimately involve infinite bounds.

Caveat

Expressions such as Infinity minus Infinity are undefined; use limits or reformulate the problem rather than expecting ordinary arithmetic.

All constants