Operators for Unary Expressions
Few operators can be used to work on single operand.
Operator | Description and Examples | Datatypes | Result type |
---|---|---|---|
not
|
Negation
|
x must be a Boolean | Boolean |
abs
|
absolute value
|
x must be a number | The type of the operand |
+
|
unary plus
|
x must be a number | The type of the operand |
-
|
unary minus
|
x must be a number | The type of the operand |
()
|
Group (that is, parentheses)
|
Any | The type of the operand |