type REAL is digits 8 range -1.0E30 .. 1.0E30;
is explained as being equivalent to the following succession of declarations
type hidden_real is new predefined_floating_point_type; subtype REAL is hidden_real digits 8 range hidden_real (-1.0E30) .. hidden_real (1.0E30); |
This means that REAL is a subtype of a type hidden_real obtained by copying a predefined floating point type. The selection of this predefined type is done by the compiler; the type chosen must support the precision required - here it must have at least 8 digits; furthermore it must support at least the range required. The fact that this selection is performed by the compiler ensures portability: the programmer need not know which floating point type is actually used.
The role played by derivation in this explanation is to provide a distinct replica of the floating point type. Thus if we write
type MY_REAL is digits 8;
we are sure of getting a new type. In particular this means that REAL and MY_REAL are distinct types.
The reason to consider REAL as a subtype of hidden_real is that for operations on values of this type, the compiler may generate code that corresponds to one of the hardware floating point types: range checks are used for assignments but not for intermediate results in expressions.