DocAda(tm) is a productivity tool of KSCE

Prev | Up | ____ | Back | Forward
About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News

3.3.2 Number Declarations

A number_declaration declares a named number.

Syntax

   
       number_declaration ::=
            defining_identifier_list : constant := static_expression;

Name Resolution Rules

The static_expression given for a number_declaration is expected to be of any numeric type.

Legality Rules

The static_expression given for a number declaration shall be a static expression, as defined by clause 4.9.

Static Semantics

The named number denotes a value of type universal_integer if the type of the static_expression is an integer type. The named number denotes a value of type universal_real if the type of the static_expression is a real type.

The value denoted by the named number is the value of the static_expression, converted to the corresponding universal type.

Dynamic Semantics

The elaboration of a number_declaration has no effect.

Examples

Examples of number declarations:

   
       Two_Pi        : constant := 2.0*Ada.Numerics.Pi;   -- a real number (see A.5)

       Max           : constant := 500;                   -- an integer number
       Max_Line_Size : constant := Max/6                  -- the integer 83
       Power_16      : constant := 2**16;                 -- the integer 65_536
       One, Un, Eins : constant := 1;                     -- three different names for 1

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
Prev | Up | ____ | Back | Forward


Copyright © 1994-1997 by Kempe Software Capital Enterprises. All Rights Reserved. For comments on this DocAda(tm) hypertext document, please write to KSCE, at docada@ksce.com