A subtype is a subrange of a larger type. Subtypes are appropriate whenever there are ranges of allowed values.
Subtypes of the same larger type are not distinct types. A subtype and the larger type are also not distinct types. Thus subtypes of the same thing are assignment-compatible.
The benefit of subtypes is that range checks avoid some nonsense.
A data type might be defined to specify the precision of a measurement. A subtype can then be defined for the reasonable values that can be obtained in measuring a particular quantity:
type measurement is digits 10; subtype pressure is measurement range 0.0 .. 3.0;
Two useful sub-types of the integers are built into Ada:
subtype POSITIVE is INTEGER range 1..INTEGER'LAST; subtype NATURAL is INTEGER range 0..INTEGER'LAST;
A distinct type could be defined for the number of people on a bus (making it a distinct type prevents other integers, like shoe sizes, from being added to it). Within that type, different limits apply to the numbers of people that are allowed to be sitting or standing on the bus. Subtypes are appropriate whenever there are ranges of allowed values.
min_on_bus : constant := 0; max_on_bus : constant := 80; type no_on_buses is range min_on_bus .. max_on_bus; max_seated : constant no_on_buses := 50; subtype seated_on_buses is no_on_buses range min_on_bus .. max_seated; subtype standing_on_buses is range min_on_bus .. (max_on_bus - max_seated);