For the Simplified Chinese translation, click 中文译文.
An unary minus operator is used to convert a number from negative to positive or vice versa.
There is no unary plus.
The example below represents the negative value of ‘8’.
When used with a variable that already has a negative value the result is positive.
For example, if $myVariable has the integer value “-7”:
The output is: