Ada Conformity Assessment Authority |
Home |
Conformity Assessment | Test Suite |
ARG | Ada Standard |

A digits_constraint
may be used to define a floating point subtype with a new value for its
requested decimal precision, as reflected by its Digits attribute. Similarly,
a delta_constraint
may be used to define an ordinary fixed point subtype with a new value
for its *delta*, as reflected by its Delta attribute.

{*AI12-0152-1*}
The simple_expression expression
of a delta_constraint
is expected to be of any real type.

For a subtype_indication
with a delta_constraint,
the subtype_mark
shall denote an ordinary fixed point subtype.

For a subtype_indication
with a digits_constraint,
the subtype_mark
shall denote either a decimal fixed point subtype or a floating point
subtype (notwithstanding the rule given in 3.5.9
that only allows a decimal fixed point subtype).

{*AI12-0152-1*}
A subtype_indication
with a subtype_mark
that denotes an ordinary fixed point subtype and a delta_constraint
defines an ordinary fixed point subtype with a *delta* given by
the value of the simple_expression expression
of the delta_constraint.
If the delta_constraint
includes a range_constraint,
then the ordinary fixed point subtype is constrained by the range_constraint.

{*AI12-0152-1*}
A subtype_indication
with a subtype_mark
that denotes a floating point subtype and a digits_constraint
defines a floating point subtype with a requested decimal precision (as
reflected by its Digits attribute) given by the value of the simple_expression expression
of the digits_constraint.
If the digits_constraint
includes a range_constraint,
then the floating point subtype is constrained by the range_constraint.

{*AI12-0152-1*}
A delta_constraint
is *compatible* with an ordinary fixed point subtype if the value
of the simple_expression expression
is no less than the *delta* of the subtype, and the range_constraint,
if any, is compatible with the subtype.

{*AI12-0152-1*}
A digits_constraint
is *compatible* with a floating point subtype if the value of the
simple_expression expression
is no greater than the requested decimal precision of the subtype, and
the range_constraint,
if any, is compatible with the subtype.

In Ada 83, a delta_constraint
is called a fixed_point_constraint, and a digits_constraint
is called a floating_point_constraint. We have adopted other terms because
digits_constraints
apply primarily to decimal fixed point types now (they apply to floating
point types only as an obsolescent feature).

{*AI12-0152-1*}
**Corrigendum:** Changed the syntax so that
the value following **delta** in a delta_constraint
is a simple_expression.
This is compatible as any expressions that would require extra parentheses
are already illegal. The change is necessary to eliminate syntax ambguities
in derived_type_definitions.
The similar change for digits_constraint
is documented in 3.5.9.

Ada 2005 and 2012 Editions sponsored in part by **Ada-Europe**