Unary operations: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
(edit)
 
(edit)
Line 15: Line 15:
|width="10%"|'''-'''||unary minus, returns the opposite of its operand
|width="10%"|'''-'''||unary minus, returns the opposite of its operand
|}
|}
<noinclude>
[[Category:Operators]]
</noinclude>

Revision as of 18:07, 8 January 2012

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

Below is the list of unary operators:

Operator Effect
~ negation operator, returns true if its operand is false, returns false if its operand is true
not same as ~ operator above
+ unary plus, returns its operand
- unary minus, returns the opposite of its operand