Ada Fundamentals - Primitive Types


Example Program (From Last Year)

Integer'Image - An Attribute of type Integer

Package Ada.Integer_Text_IO

Integer Input: Ada.Integer_Text_IO.get

Size Attribute

Sizes of Integer Types

Floating Point Types

Package Ada.Float_Text_IO

Primitive Types

Another Meaning of Primitive

Very Strong Type Checking

Explicit Type Conversion

Language Comparison: Implicit and Explicit Type Conversion

Language Comparison: Type Conversion with Subtypes in Ada and Java

Operators: Precedence and Associativity

Examples using Arithmetic Operators

Rem and Mod Operators

Rem Operator

Mod Operator

A Final Word on Integer Division

Rem and Mod and Other Languages

Examples using Relational and Boolean Operators

Example using String Concatenation Operator

        put_line("Hello, this certainly is a "
                & "really long line!");

Short Circuit: and then, or else

in Membership Test

        if i in 1 .. 10 then