Binary operations: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
(edit)
(edit)
Line 4: Line 4:
<br>
<br>
<nowiki>
<nowiki>
=
=       may be used for assignment or comparing 2 values
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
:=
:=       forced assignment
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
<>
<>       not equal
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
&
&       concatenation of strings
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
*
*       multiplication
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
*=
*=       multiplication/assignment
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
+
+       addition
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
+=
+=       addition/assignment
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
-
-       subtraction
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
-=
-=       subtraction/assignment
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
/
/       division
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
/=
/=       division/assignment
</nowiki>
</nowiki>


Line 69: Line 69:
<br>
<br>
<nowiki>
<nowiki>
<=
<=       less than or equal to
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
==
==       equality
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
>
>       more than
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
>=
>=       more than or equal to
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
and
and     logical AND
</nowiki>
</nowiki>


<br>
<br>
<nowiki>
<nowiki>
or
or       logical OR
</nowiki>
</nowiki>

Revision as of 17:30, 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 or equal to


== equality


> more than


>= more than or equal to


and logical AND


or logical OR