ada Scalar Types

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

In Ada's hierarchy of types, elementary types have sets of logically indivisible values. Among these types are the access types (pointer types) and the scalar types. The scalar types can be categorised as enumeration, character, and numeric. These types form the subject of this topic. In addition to the sets of values, types have set of operations applicable to the respective scalars, such as successor, or "+".

Syntax

  1. typeis

Parameters

EllipsisWhat
… (1)to receive the type's name
… (2)to receive the type's characteristics using keywords: delta, digits, range

Remarks

All scalar type definitions except enumeration and modular integers may include a range constraint.

A range constraint specifies a lower bound and an upper bound of the set of values to include in the type. For fixed point types, specifying a range is mandatory: values of these types will be understood to be multiples of a small fraction of two, for example, of 1/25. The smaller these fractions become, the more precise the representation, at the cost of range that can be represented using the bits available.

Further aspects of type definitions may be given, such as a desired Size in bits and other representational items. Ada 2012 adds aspects of contract based programming like Static_Predicate.



Got any ada Question?