Topic: range data type

topics > computer science > data > data type > Group: derived data types

data type as a set of values
enumerated data types
index sequence for array access
ordered data types
range checking
representation data type
restricted and extended types
variables for array bounds


A range is a bounded sub-set of values, usually integer. Other base types may be used if a successor function is defined. For instance real value ranges are defined with a step size. Procedures are used to modify range-valued variables and replace them from uncontrolled values. Ranges may be used in array bounds declarations, case statement guards, for loops, input range checking and data type checking. Named ranges assure compatibility between multiple uses and allow representation independence. The lower and upper bound of a range can also be labeled. (cbb 5/80)
Subtopic: subrange types up

Quote: a subrange is called a subtype in Ada; it inherits operations and remains compatible [»maclBJ_1987]
Quote: a subrange has the same signature as the enumeration plus operations for converting between the two [»demeA3_1979]
Quote: all enumerated and subrange types have standard set of accessing functions such as 'first' and 'pred' [»veneT3_1978]
Quote: Improv items can be collected into a group and used as a range; ranges can also be itemA..itemB [»yageT10_1990]

Subtopic: domain value up

QuoteRef: mcleDJ3_1976 ;;47 domains subset of reals or strings. normalized relations of tuples where each element is in corresponding domain eg name, age, occupation

Subtopic: interval tree up

Quote: hierarchical access rights by interval containment in an interval tree; efficient representation for many users and access groups [»luQ_1999]

Subtopic: range query up

Quote: optimal, approximate range query using skip quadtrees; produces a convex or non-convex k-fat region [»eppsD6_2005]

Subtopic: field-width up

Quote: prescribing the number of digits in a date field is a trivial design decision; it is a scandal only because it is expensive to change [»creeC11_1997]
Note: changing the bit-width of a data type changes "infinity" or adds overflow checking [»cbb_1990, OK]

Subtopic: examples up

QuoteRef: flonL9_1974 ;;8 a type range of reals with fixed step size
QuoteRef: hogbD10_1971 ;;19 index list by 1***8 (i.e. 1,2,3...8). reference to box by *row,col*
QuoteRef: wirtN1_1971 ;;37 allow subrange types eg integer 1-10 by 1..10 [42]
QuoteRef: morrJH8_1972 ;;761 ranges 0 =< a =< 10 from 0 to 10 by succ(a) k >= 1 as n times from 1 -> 1+(n-1)
QuoteRef: bartCW7_1974 ;;292 Hoare: case labels indicating a range eg Feb...Apr
QuoteRef: reynJC5_1970 ;;310 atoms LL and UL such that in indexing function f(LL) is low bound .#@#

Subtopic: no need for subrange up

Quote: Oberon users do not miss enumerations, subranges, submodules, automatic qualifications, general indexing, for-statements, etc. [»wirtN9_1989]
Quote: enumeration types should be dropt; defy extensibility and, with subranges, lead to a type explosion [»wirtN7_1988]

Related Topics up

Topic: data type as a set of values (20 items)
Topic: enumerated data types (17 items)
Topic: index sequence for array access (16 items)
Topic: ordered data types (8 items)
Topic: range checking (20 items)
Topic: representation data type (21 items)
Topic: restricted and extended types (35 items)
Topic: variables for array bounds
(7 items)

Updated barberCB 12/04
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.