Sep 22, 2003 ------------- - Type - a set of values, together with set of operations on those values having certain properties - Several classifications possible, one of them: - primitive - boolean - integer - real - decimal - character - constructed - array - enum - cartesian product (struct) - union - discriminated - undiscriminated - subset - subrange - powersets - pointers and referential types - file - where do "strings" fit in? - Another classification - ordinal types - enum - subrange - all others! - What will we study in this chapter? for each type: - what values are legal in the type? - how are objects of a given type addressed? - what operations are available? - what properties are there? why should we use this type? - Main primitive types and some issues involving them - bool - should it be an ordinal type? - integer - what representation is good: 2s comp, 1s comp etc. - real - IEEE FPS - what about representing 0.1 on the computer? - decimal - binary coded decimal - char - 7-bit, 8-bit, and Unicode formats - strings - should they be a primitive type (e.g., BASIC) - or constructed (e.g., C)