Binary operations: Difference between revisions
(edit) |
(edit) |
||
Line 2: | Line 2: | ||
Below is the list of binary operators: | Below is the list of binary operators: | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
= may be used for assignment or comparing 2 values | '''=''' may be used for assignment or comparing 2 values | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
:= forced assignment | ''':=''' forced assignment | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
<> not equal | '''<>''' not equal | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
& concatenation of strings | '''&''' concatenation of strings | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
* multiplication | '''*''' multiplication | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
*= multiplication/assignment | '''*=''' multiplication/assignment | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
+ addition | '''+''' addition | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
+= addition/assignment | '''+=''' addition/assignment | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
- subtraction | '''-''' subtraction | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
-= subtraction/assignment | '''-=''' subtraction/assignment | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
/ division | '''/''' division | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
/= division/assignment | '''/=''' division/assignment | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
< | '''<''' less than | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
<= less than or equal to | '''<=''' less than or equal to | ||
</nowiki> | </nowiki> | ||
Line 79: | Line 80: | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
> more than | '''>''' more than | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
>= more than or equal to | '''>=''' more than or equal to | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
and logical AND | '''and''' logical AND | ||
</nowiki> | </nowiki> | ||
<br> | <br> | ||
<nowiki> | <nowiki> | ||
or logical OR | '''or''' logical OR | ||
</nowiki> | </nowiki> |
Revision as of 17:32, 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:
'''=''' may be used for assignment or comparing 2 values
''':=''' 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