Unary Operators - ArdaOzcan/Boink GitHub Wiki
Table of Contents
Unary Operators
Positive
+ operator does nothing to a numerical type.
Supported and resulting types:
- +int = int
- +float = float
- +double = double
Examples:
int new = +3 # 'new' is 3
float new = +3.0f # 'new' is 3.0f
double new = +3.0 # 'new' is 3.0
Negative
- operator negates a numerical type.
Supported and resulting types:
- -int = int
- -float = float
- -double = double
Examples:
int new = -3 # 'new' is -3
float new = -3.0f # 'new' is -3.0f
double new = -3.0 # 'new' is -3.0