Range (computer programming): Difference between revisions

Content deleted Content added
m clean up using AWB
range of variable is all possible values not just min and max
Line 1:
{{Unreferenced|date=December 2006}}
In [[computer science]], the term '''range''' may refer to one of two things:
# The maximum and minimumpossible values that may be stored in a [[variable (programming)|variable]].
# The upper and lower bounds of an [[array]].
 
==Range of a variable==
theThe range of a [[signedness|signed]]variable [[16-bit]]is [[Integergiven (computeras science)|integer]]the variableset isof -32,768possible tovalues +32,767that that variable can hold. 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). For example, the range of a [[signedness|signed]] [[16-bit]] [[Integer (computer science)|integer]] variable is all the integers from -32,768 to +32,767. 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.
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 [[signedness|signed]] [[16-bit]] [[Integer (computer science)|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==