A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.wikibooks.org/wiki/Ada_Programming/Operators below:

Ada Programming/Operators - Wikibooks, open books for an open world

From Wikibooks, open books for an open world

Ada. Time-tested, safe and secure.

Ada allows operator overloading for all standard operators and so the following summaries can only describe the suggested standard operations for each operator. It is quite possible to misuse any standard operator to perform something unusual.

Each operator is either a keyword or a delimiter—hence all operator pages are redirects to the appropriate keyword or delimiter.

Operators have arguments which in the RM are called Left and Right for binary operators, Right for unary operators (indicating the position with respect to the operator symbol).

The list is sorted from lowest precedence to highest precedence.

and
and x ∧ y {\displaystyle x\land y} , (also keyword and)
or
or x ∨ y {\displaystyle x\lor y} , (also keyword or)
xor
exclusive or ( x ∧ y ¯ ) ∨ ( x ¯ ∧ y ) {\displaystyle (x\land {\bar {y}})\lor ({\bar {x}}\land y)} , (also keyword xor)
/=
Not Equal x ≠ y {\displaystyle x\neq y} , (also special character /=)
=
Equal x = y {\displaystyle x=y} , (also special character =)
<
Less than x < y {\displaystyle x<y} , (also special character <)
<=
Less than or equal to ( x ≤ y {\displaystyle x\leq y} ), (also special character <=)
>
Greater than ( x > y {\displaystyle x>y} ), (also special character >)
>=
Greater than or equal to ( x ≥ y {\displaystyle x\geq y} ), (also special character >=)
+
Add x + y {\displaystyle x+y} , (also special character +)
-
Subtract x − y {\displaystyle x-y} , (also special character -)
&
Concatenate , x {\displaystyle x} & y {\displaystyle y} , (also special character &)
+
Plus sign + x {\displaystyle +x} , (also special character +)
-
Minus sign − x {\displaystyle -x} , (also special character -)
*
Multiply, x × y {\displaystyle x\times y} , (also special character *)
/
Divide x / y {\displaystyle x/y} , (also special character /)
mod
modulus (also keyword mod)
rem
remainder (also keyword rem)
**
Power x y {\displaystyle x^{y}} , (also special character **)
not
logical not ¬ x {\displaystyle \lnot x} , (also keyword not)
abs
absolute value | x | {\displaystyle |x|} (also keyword abs)

These are not operators and thus cannot be overloaded.

and then
e.g. if Y /= 0 and then X/Y > Limit then ...
or else
e.g. if Ptr = null or else Ptr.I = 0 then ...

The Membership Tests also cannot be overloaded because they are not operators.

in
element of, v a r ∈ t y p e {\displaystyle var\in type} , e.g. if I in Positive then, (also keyword in)
not in
not element of, v a r ∉ t y p e {\displaystyle var\notin type} , e.g. if I not in Positive then, (also keywords not in)
if Today not in Tuesday .. Thursday then
   ...
Is_Non_Negative := X in Natural;
exit when Object in Circle'Class;
if Today not in Tuesday .. Thursday then
   ...

This language feature has been introduced in Ada 2012.

Ada 2012 extended the membership tests to include the union (short-circuit or) of several range or value choices.

if Today in Monday .. Wednesday | Friday then
   ...

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3