Bounds checking
In programming, detecting whether a variable is within given bounds before use / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Bounds checking?
Summarize this article for a 10 year old
SHOW ALL QUESTIONS
In computer programming, bounds checking is any method of detecting whether a variable is within some bounds before it is used. It is usually used to ensure that a number fits into a given type (range checking), or that a variable being used as an array index is within the bounds of the array (index checking). A failed bounds check usually results in the generation of some sort of exception signal.
This article includes a list of general references, but it lacks sufficient corresponding inline citations. (March 2012) |
As performing bounds checking during each use can be time-consuming, it is not always done. Bounds-checking elimination is a compiler optimization technique that eliminates unneeded bounds checking.