Range error (Definition)

Some functions (especially math functions) have a limited range of valid arguments.

Range errors occur when the value passed to a function falls outside the range of possible valid values for that function. This problem is most prevalent with functions belonging to the Math object.

An out of range error is caused because the function cannot resolve the input value to a meaningful output value.

Because JavaScript is more forgiving than a compiled language, these exceptions are managed by returning one of the following values:

The host implementation may provide other values and, if it so chooses, can deliver a specific range error value for its own function calls.

Refer to descriptions of the Math object and its functions for details of the range of suitable values for each function call.

See also:Infinity, Math object, Mathematics, Minima-maxima, NaN, Null literal, undefined, Undefined behavior