Skip to main content

J.6 Numeric_Error

danger

This Reference Manual output has not been verified, and may contain omissions or errors. Report any problems on the tracking issue

Static Semantics

1

The following declaration exists in the declaration of package Standard:

2

Numeric_Error : exception renames Constraint_Error;

2.a
discussion

This is true even though it is not shown in A.1.

2.b
reason

In Ada 83, it was unclear which situations should raise Numeric_Error, and which should raise Constraint_Error. The permissions of RM83-11.6 could often be used to allow the implementation to raise Constraint_Error in a situation where one would normally expect Numeric_Error. To avoid this confusion, all situations that raise Numeric_Error in Ada 83 are changed to raise Constraint_Error in Ada 95. Numeric_Error is changed to be a renaming of Constraint_Error to avoid most of the upward compatibilities associated with this change.

2.c

In new code, Constraint_Error should be used instead of Numeric_Error.