For the Simplified Chinese translation, click 中文译文.

## 1 Introduction

An unary minus operator is used to convert a number from negative to positive or vice versa.

There is no unary plus.

## 2 Example

The example below represents the negative value of ‘8’.

```
-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”:

```
-$myVariable
```

The output is:

```
7
```