Jump to content

Ada Programming/Delimiters/-

From Wikibooks, open books for an open world

Ada. Time-tested, safe and secure.
Ada. Time-tested, safe and secure.

Operator

[edit | edit source]

Standard Operations

[edit | edit source]

Arithmetic Subtraction

[edit | edit source]

The "-" operator is defined as arithmetic subtraction for all numeric types.

function "-" (Left, Right : T) return T;
Usage
[edit | edit source]
A : constant Float   := 5.0 - 2.0;  -- A is now 3.0
B : constant Integer := 5 - 2;      -- B is also 3

Minus sign

[edit | edit source]

The "-" unary operator is defined as arithmetic negative sign for all numeric types.

function "-" (Left : T) return T;
Usage
[edit | edit source]
A : constant Float   := -5.0;
B : constant Integer := -5;
C : constant Integer := -B;  -- C is now 5

See also

[edit | edit source]

Wikibook

[edit | edit source]

Ada 95 Reference Manual

[edit | edit source]

Ada 2005 Reference Manual

[edit | edit source]



Ada Operators
and and then > + abs &
or or else >= - mod
xor = < * rem in
not /= <= ** / not in