Binary operations: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
(edit)
(edit)
Line 3: Line 3:
Below is the list of binary operators:
Below is the list of binary operators:


<br>
<nowiki>
'''='''        may be used for assignment or comparing 2 values
</nowiki>


<br>
{|
<nowiki>
|-valign="top"
''':='''       forced assignment
|width="10%"|'''Operator'''|| '''Effect'''
</nowiki>
|-valign="top"
 
|width="10%"|'''='''||may be used for assignment or comparing 2 values like the '''==''' operator
<br>
|-valign="top"
<nowiki>
|width="10%"|''':='''||forced assignment
'''<>'''       not equal
|-valign="top"
</nowiki>
|width="10%"|'''<>'''||not equal
 
|-valign="top"
<br>
|width="10%"|'''&'''||concatenation of strings
<nowiki>
|-valign="top"
'''&'''       concatenation of strings
|width="10%"|'''*'''||multiplication
</nowiki>
|-valign="top"
 
|width="10%"|'''*='''||multiplication/assignment
<br>
|-valign="top"
<nowiki>
|width="10%"|'''+'''||addition
'''*'''       multiplication
|-valign="top"
</nowiki>
|width="10%"|'''+='''||addition/assignment
 
|-valign="top"
<br>
|width="10%"|'''-'''||subtraction
<nowiki>
|-valign="top"
'''*='''       multiplication/assignment
|width="10%"|'''-='''||subtraction/assignment
</nowiki>
|-valign="top"
 
|width="10%"|'''/'''||division
<br>
|-valign="top"
<nowiki>
|width="10%"|'''/='''||division/assignment
'''+'''       addition
|-valign="top"
</nowiki>
|width="10%"|'''<'''||less than
 
|-valign="top"
<br>
|width="10%"|'''<='''||less than or equal to
<nowiki>
|-valign="top"
'''+='''       addition/assignment
|width="10%"|'''=='''||equality
</nowiki>
|-valign="top"
 
|width="10%"|'''>'''||more than
<br>
|-valign="top"
<nowiki>
|width="10%"|'''>='''||more than or equal to
'''-'''       subtraction
|-valign="top"
</nowiki>
|width="10%"|'''and'''||logical AND
 
|-valign="top"
<br>
|width="10%"|'''or'''||logical OR
<nowiki>
|}
'''-='''       subtraction/assignment
</nowiki>
 
<br>
<nowiki>
'''/'''       division
</nowiki>
 
<br>
<nowiki>
'''/='''       division/assignment
</nowiki>
 
<br>
<nowiki>
'''<'''       less than
</nowiki>
 
<br>
<nowiki>
'''<='''       less than or equal to
</nowiki>
 
<br>
<nowiki>
==       equality
</nowiki>
 
<br>
<nowiki>
'''>'''       more than
</nowiki>
 
<br>
<nowiki>
'''>='''       more than or equal to
</nowiki>
 
<br>
<nowiki>
'''and'''     logical AND
</nowiki>
 
<br>
<nowiki>
'''or'''       logical OR
</nowiki>

Revision as of 17:53, 8 January 2012

A binary operator is an operator which takes 2 arguments, as opposed to a unary operators, which take 1 argument.

Below is the list of binary operators:


Operator Effect
= may be used for assignment or comparing 2 values like the == operator
:= forced assignment
<> not equal
& concatenation of strings
* multiplication
*= multiplication/assignment
+ addition
+= addition/assignment
- subtraction
-= subtraction/assignment
/ division
/= division/assignment
< less than
<= less than or equal to
== equality
> more than
>= more than or equal to
and logical AND
or logical OR