Below is a complete list of all operators and what they do.
Operator  Type  Description  Overridable  Sample  Result 

and  Binary  Boolean AND operator  ✓  true and false 
false 
or  Binary  Boolean OR operator  ✓  true or false 
true 
not  Unary  Boolean NOT operator  ✓  not false 
true 
nand  Binary  Boolean NAND operator—shortcut for not (a or b) 
true nand false 
true 

nor  Binary  Boolean NOR operator—shortcut for not (a and b) 
false nor true 
false 

xor  Binary  Boolean XOR operator—shortcut for (a and not b) or (not a and b) 
false xor true 
true 

xnor  Binary  Boolean XNOR operator—shortcut for not a and not b 
false xnor true 
false 

band  Binary  Bitwise AND operator  
bor  Binary  Bitwise OR operator  
bnot  Unary  Bitwise NOT operator  
bnand  Binary  Bitwise NAND oeprator—shortcut for not(a bor b) 

bnor  Binary  Bitwise NOR operator—shortcut for bnot (a band b) 

bxor  Binary  Bitwise XOR operator—shortcut for (a band bnot b) bor (bnot a band b) 

bxnor  Binary  Bitwise XNOR operator—shortcut for bnot a band bnot b 

+  Binary  addition operator  ✓  3 + 5 
8 
  Binary  subtraction operator  ✓  3  5 
2 
*  Binary  multiplication operator  ✓  3 * 5 
15 
/  Binary  division operator  ✓  15 / 3 
5 
mod  Binary  modulus operator  5 mod 3 
2 

div  Binary  integer division operator  5 div 3 
1 

^  Binary  mathematical exponential operator  ✓  3 ^ 2 
9 
&  Psuedounary  When this appears before the name of a procedure or property, returns a delegate instance to that procedure or property  
?  Type modifier  Turns a primitive (not structs or enums) into one that can be null—Except for boolean, this may add at least one byte to the storage needed  var ? int 

()  Innerparameter  Parenthetical operator  
  Innerparameter  Mathematical absolute value operator  5 
5 

[]  Type modifier  Turns a type into an array of the type  var int[] array = new int[3] 

[]  Innerparameter  Array indexer  list[5] 

[]  Innerparameter  (When used with new) allocates an array of size X  new String[5] 

{}  Type modifier  Turns a type into a set of that type  var int{} v = new int{} 5, 3, 7, 9 

{}  Innerparameter list  (When used with new) Used to write a set constant  new int{} 3, 5, 6, 34 new int{SomeFixedSetInstance} 5, 3, 6, 34 

{}f  Type modifier  Turns a type into a fixed set  var int{}f fixed = new int{}f 3, 5, 9, 34</ocde> 

{}f  Innerparameter list  (When used with new) Used to write a set constant that can't have other members—used to control what can be in normal sets  new int{}f 3, 5, 6, 23 

.  Psuedobinary  Used to access the members of a struct or class  name.member 

,  Pseudobinary  Used to delimit lists when no custom keyword has been specified  
=  Binary  Assignment operator—copies the reference if this is a reference type—not valid for structs  a = b 

=  Binary  Equality comparison operator—compares only the reference if this is a reference type—not valid for structs  if a = b then 

<> ( or ><)  Binary  Inequality comparison operator—compares only the reference if this is a reference type—not valid for structs  if a <> b then 

<= (or =<)  Binary  Less than or equal comparison operator—Undefined by default for nonnumeric types  ✓  if a <= b then 

<  Binary  Less than comparison operator—Undefined by default for nonnumeric types  ✓  if a < b then 

>= (or =>)  Binary  Greater than or equal comparison operator—Undefined by default for nonnumeric types  ✓  if a >= b then 

>  Binary  Greater than comparison operator—Undefined by default for nonnumeric types  ✓  if a > b then 

@  Psuedobinary  Base class selector  base@ClassName 

++  Unary  Increment operator  ✓  x ++ 

++  Binary  Increment operator  ✓  x ++ y 

  Unary  Decrement operator  ✓  x  

  Binary  Decrement operator  ✓  x  y 
This lists all operators in order of precedence, starting with the highest precedence operators:
, o{} {} [] () and or xor xnor nand nor * / +  & = ++  <> >< <= =< < >= => > band bor bxor bxnor bnand bnor not bnot @
ASIL allows comparison operators to be chained as long as the resulting expression forms a range. So 4 < a and a < 8
could be written as 4 < a < 8
. This is meant to be transparent to those overriding these operators. Below are some samples of situations that can or can’t be combined.
a < b and b < c ' Not a range as there aren’t any constants 4 < b and c > 8 ' Not a range as the operators don’t “point” in the same direction 4 < b and b <= 8 ' Valid range as the operators agree so this could be “4 < b < 8”
You can also chain equality operators as shown below.
(a = b = c) = (a = b and a = c) ' This will always be true
Something like a = b = c
will attempt to set a
and b
to the value of c
. If you need to force “b = c” to be a comparison, use the syntax provided in the next section.
If ASIL gives you the wrong operator, you can call it with something like typename.+ parameterlist
. The code below shows how to set a boolean to the result of a comparison.
Note: The assignment operator can’t be selected this way. This is deliberate and prevents you from making assignments when you wanted a comparison.
var boolean b = c% = d% ' wrong var boolean b = int.= c%, d% ' correct
Some comparison operators can be referenced with either of two “names”. Those are listed in the table below. The “type” part is a placeholder for the real type name.
Name 1  Name 2 

type.<>  type.>< 
type.<=  type.=< 
type.=>  type.>= 
Wiki: Custom operators
Wiki: Home
Wiki: keywordsoperator
Wiki: operatorsabs
Wiki: operatorsaddition
Wiki: operatorsamp
Wiki: operatorsand
Wiki: operatorsat
Wiki: operatorsband
Wiki: operatorsbnand
Wiki: operatorsbnor
Wiki: operatorsbnot
Wiki: operatorsbor
Wiki: operatorsbraces
Wiki: operatorsbracesf
Wiki: operatorsbrackets
Wiki: operatorsbxnor
Wiki: operatorsbxor
Wiki: operatorscanbenull
Wiki: operatorscomma
Wiki: operatorsdec
Wiki: operatorsdiv
Wiki: operatorsequals
Wiki: operatorsexponential
Wiki: operatorsfloatdivision
Wiki: operatorsgtequal
Wiki: operatorsgt
Wiki: operatorsinc
Wiki: operatorsinequality
Wiki: operatorsltequal
Wiki: operatorslt
Wiki: operatorsmemberaccess
Wiki: operatorsminus
Wiki: operatorsmod
Wiki: operatorsmultiplication
Wiki: operatorsnand
Wiki: operatorsnor
Wiki: operatorsnot
Wiki: operatorsor
Wiki: operatorsparen
Wiki: operatorsxnor
Wiki: operatorsxor