The model numbers for a fixed point type having a null range AI00340/06 1
890616 ra WA
 !standard 03.05.09 (06) 890616 AI00340/06
!class ramification 850618
 !status WG9approved 890616
!status approved by WG9 881028 (provisionally approved)
!status ARGapproved 880503 (reviewed)
!status ARGapproved (1600) 870915 (pending editorial review)
!status panelapproved (600) 870915
!status workitem 870806
!status received 850618
!references AI00174, 8300556, 8300948
 !topic The model numbers for a fixed point type having a null range

 !summary 880330
The set of model numbers for a fixed point type (or subtype) is determined by
the values of the bounds in the range constraint and not by whether the
specified range is null or not. Even for a null range, the model numbers are
chosen to ensure each bound is either included in the range of model numbers
or lies at most SMALL distant from a model number.
 !question 880503
Consider the following null range fixed point type:
type F1 is delta 1.0 range 100.0 .. 100.0;
Is the set of model numbers for type F1 void? What are the values of the
attributes of type F1, especially F1'MANTISSA, F1'FIRST, and F1'LAST?
3.5.9(6) says:
For a fixed point constraint that includes a range constraint,
the model numbers comprise zero and all multiples of SMALL whose
MANTISSA can be expressed using exactly B binary digits, where
the value of B is chosen as the smallest integer number for which
each bound of the specified range is either a model number or
lies at most SMALL distant from a model number.
If 3.5.9(6) is taken literally, then the set of model numbers is never void;
it always has at least one element, i.e., zero, and moreover, since B is
always greater than zero (3.5.9(4)), SMALL and SMALL are model numbers too.
3.5.9(6) seems to imply that, even though the range is null, there must be a
sufficiently large mantissa size B, and hence sufficient model numbers, to
represent the values of the bounds given in the type definition's range
constraint. If so, then two different null range fixed point types can have
different values for 'FIRST and 'LAST. For example, type F1 would have more
model numbers than
type F2 is delta 1.0 range 3.0 .. 3.0;
and F1'LAST would be 100.0 whereas F2'LAST would be 3.0. Is this intended?
The model numbers for a fixed point type having a null range AI00340/06 2
890616 ra WA
 !response 881205
As 3.5.9(6) says, the set of model numbers always has at least the value zero
as an element. The other model numbers are determined by SMALL and the size
B of the mantissa. 3.5.9(5) determines the value of SMALL as follows:
For the model numbers defined by a fixed point constraint, the
number SMALL is chosen as the largest power of two that is not
greater than the delta of the fixed accuracy definition.
Alternatively, it is possible to specify the value of SMALL by a
length clause (see 13.2), in which case model numbers are
multiples of the specified value.
Then 3.5.9(6) determines the mantissa size B such that the lower and upper
bounds fall in the correct model interval (see AI00174). The following
examples show the resulting attribute values for several fixed point type
definitions.
type F1 is delta 1.0 range 100.0 .. 100.0;
 F1'MANTISSA = 7
 F1'SMALL = 1.0
 F1'LARGE = 127.0
 F1'FIRST = 100.0
 F1'LAST = 100.0
type F2 is delta 1.0 range 3.0 .. 3.0;
 F2'MANTISSA = 2
 F2'SMALL = 1.0
 F2'LARGE = 3.0
 F2'FIRST = 3.0
 F2'LAST = 3.0
type F3 is delta 1.0 range 4.0 .. 2.0;
 F3'MANTISSA = 2
 F3'SMALL = 1.0
 F3'LARGE = 3.0
 3.0 <= F3'FIRST <= 4.0
 F3'LAST = 2.0
type F4 is delta 8.0 range 2.0 .. 2.0;
 F4'MANTISSA = 1
 F4'SMALL = 8.0
 F4'LARGE = 8.0
 0.0 <= F4'FIRST <= 8.0
 0.0 >= F4'LAST >= 8.0
Since both bounds for F4 fall in model intervals bounded by 0.0, the actual
value of F4'FIRST and F4'LAST can be 0.0, in which case, F4 does not have a
null range.
The model numbers for a fixed point type having a null range AI00340/06 3
890616 ra WA
type F5 is delta 1.0 range 1.0 .. 1.0;
 F5'MANTISSA = 1
 F5'SMALL = 1.0
 F5'LARGE = 1.0
 F5'FIRST = 1.0
 F5'LAST = 1.0
F5'MANTISSA is 1 since 3.5.9(4) requires that the mantissa of a model number
be positive, i.e., greater than zero. Consequently, the largest model number
is 1.0, and the smallest model number is 1.0. Since the bounds of the range
are therefore model numbers, F5'FIRST is 1.0 and F5'LAST is 1.0.