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:
NaN
+Infinity
-Infinity
undefined
null
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 |
Prev | Home | Next |
RandomDissolve() | Up | RangeError object |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |