Ada Programming/Delimiters/-
From Wikibooks, open books for an open world
Contents |
[edit] Operator
[edit] Standard Operations
[edit] Arithmetic Subtraction
The "-" operator is defined as arithmetic subtraction for all numeric types.
function "-" (Left, Right : T) return T;
[edit] Usage
A : constant Float := 5.0 - 2.0; -- A is now 3.0 B : constant Integer := 5 - 2; -- B is also 3
[edit] Minus sign
The "-" unary operator is defined as arithmetic negative sign for all numeric types.
function "-" (Left : T) return T;
[edit] Usage
A : constant Float := -5.0; B : constant Integer := -5; C : constant Integer := -B; -- C is now 5
[edit] See also
[edit] Wikibook
- Ada Programming
- Ada Programming/Delimiters
- Ada Programming/Operators
- Ada Programming/Mathematical calculations
[edit] Ada 95 Reference Manual
- 4.4 Expressions (Annotated)
- 4.5.3 Binary Adding Operators (Annotated)
- 4.5.4 Unary Adding Operators (Annotated)
[edit] Ada 2005 Reference Manual
- 4.4 Expressions (Annotated)
- 4.5.3 Binary Adding Operators (Annotated)
- 4.5.4 Unary Adding Operators (Annotated)
| Ada Operators | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|