The definition of the attribute FORE AI00179/08 1
880613 ra WJ
 !standard 03.05.10 (08) 880613 AI00179/08
!class ramification 850905
 !status approved by WG9/AJPO 880205 (corrected in accordance with AI00467)
 !status approved by WG9/AJPO 860722
!status approved by Director, AJPO 860722
!status approved by WG9/Ada Board 860722
!status approved by Ada Board 860722
!status approved by WG9 851118
!status committeeapproved (1000) 850905
!status workitem 840611
!status received 840125
 !references 8300265, 8300654, 8300803
!topic The definition of the attribute FORE
!summary 850918
The attribute 'FORE is defined in terms of the decimal representation of
model numbers.
!question 850918
For a fixed point type definition such as
type F is delta 0.1 range 0.0 .. 9.96;
for F'SMALL use 0.01;
is the value of F'FORE 2 or 3? Note that when outputting F'LAST with an AFT
of 1, the string " 10.0" will be produced, and this string requires a FORE of
3.
 !response 880613
The Standard gives the following definition for 'FORE:
Yields the minimum number of characters needed for the integer
part of the decimal representation of any value of the subtype T,
assuming that the representation does not include an exponent,
but includes a onecharacter prefix that is either a minus sign
or a space. ...
For a fixed point subtype declared as follows:
type F is delta 0.1 range 0.0 .. 9.96;
for F'SMALL use 0.01;
the value of 'FORE is 2 since the straightforward interpretation of "decimal
representation of any value of the subtype" means the exact decimal
representation of the model numbers belonging to F. In this case, the value 2
is unsuitable when certain values, e.g., 9.96, are output with an AFT of 1.
It is up to the programmer to take this effect into account when using fixed
point output formats.
The value returned by 'FORE can be implementation dependent. For example:
The definition of the attribute FORE AI00179/08 2
880613 ra WJ
type G is delta 0.01 range 1.00 .. 10.00;
for G'SMALL use 0.01;
 subtype SG is F delta 0.01 range 1.00 .. 9.995;

 For the subtype SG, 9.99 and 10.00 are consecutive model numbers (3.5.9(14)).
It is implementation dependent whether the upper bound of SG is represented
 as the model number 9.99 or the model number 10.0. Depending on the
implementation's choice, the value returned by SG'FORE will be either 2 or 3.
In addition, note that the bounds of SG need not be given by static
expressions. If the upper bound is nonstatic and has a value lying in the
 model interval 9.99 to 10.00, SG'FORE's value will be implementation
dependent (and must be computed at runtime). The fact that 'FORE may return
implementation dependent values should be taken into consideration by
programmers.