J.3 Reduced Accuracy Subtypes
1
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.
1.a
Discussion: It might be more direct to
make these attributes specifiable via an
attribute_definition_clause,
and eliminate the syntax for these
_constraints.
Syntax
2
Name Resolution Rules
3
Legality Rules
4
5
6
6.a/2
This paragraph
was deleted.Discussion: {
AI95-00114-01}
We may need a better way to deal with obsolescent
features with rules that contradict those of the non-obsolescent parts
of the standard.
Static Semantics
7
8
Dynamic Semantics
9
10
A
digits_constraint
is
compatible with a floating point subtype if the value of the
expression
is no greater than the requested decimal precision of the subtype, and
the
range_constraint,
if any, is compatible with the subtype.
11
11.a
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
11.b
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).
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe