BookRags.com Literature Guides Literature
Guides
Criticism & Essays Criticism &
Essays
Questions & Answers Questions &
Answers
Lesson Plans Lesson
Plans
My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help
Not What You Meant?  There are 16 definitions for Range.

Range (computer science)

Print-Friendly
About 1 pages (271 words)

Bookmark and Share Questions on this topic? Just ask!

In computer science, the term range may refer to one of two things:

  1. The maximum and minimum values that may be stored in a variable.
  2. The upper and lower bounds of an array.

Range of a variable

The range of a variable is given as the difference between the highest and lowest value that that variable can hold. For example, the range of a signed 16-bit integer variable is -32,768 to +32,767. In the case of an integer, the variable definition is restricted to whole numbers only, and the range will cover every number within its range (including the maximum and minimum). However, for other numeric types, such as floating point numbers, the range only expresses the largest and smallest number that may be stored - within the range there will be many numbers that cannot be represented.

Range of an array

When an array is numerically indexed, its range is the upper and lower bound of the array. In most programming languages a warning, or possibly a fatal error (or worse!) will occur if you try to access an array element that is outside the range. In some languages, such as C, arrays have a fixed lower bound (zero) and will contain data at each position up to the upper bound (so an array with 5 elements will have a range of 0 to 4). In others, such as PHP, an array may have holes where no element is defined, and therefore an array with a range of 0 to 4 will have up to 5 elements (and a minimum of 2).

View More Summaries on Range (computer science)
 
Ask any question on Range (computer science) and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Range (computer science) from Wíkipedia. ©2006 by Wíkipedia. Licensed under the GNU Free Documentation License. View a list of authors or edit this article.

Article Navigation
Join BookRagslearn moreJoin BookRags




About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy