Ada Programming/Delimiters/-

< Ada Programming‎ | Delimiters

OperatorEdit

Standard OperationsEdit

Arithmetic SubtractionEdit

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

function "-" (Left, Right : T) return T;
UsageEdit
A : constant Float   := 5.0 - 2.0;  -- A is now 3.0
B : constant Integer := 5 - 2;      -- B is also 3

Minus signEdit

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

function "-" (Left : T) return T;
UsageEdit
A : constant Float   := -5.0;
B : constant Integer := -5;
C : constant Integer := -B;  -- C is now 5

See alsoEdit