J.3 Reduced Accuracy Subtypes
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.
Discussion: It might be more direct to
make these attributes specifiable via an
attribute_definition_clause,
and eliminate the syntax for these
_constraints.
Syntax
Name Resolution Rules
Legality Rules
Static Semantics
Dynamic Semantics
Reason: A numeric subtype is considered
“constrained” only if a range constraint applies to it. The
only effect of a
digits_constraint
or a
delta_constraint
without a
range_constraint
is to specify the value of the corresponding Digits or Delta attribute
in the new subtype. The set of values of the subtype is not “constrained”
in any way by such
_constraints.
Wording Changes from Ada 83
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).
Wording Changes from Ada 2012
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe