# - arithmetic operator

The - arithmetic operator designates
a subtraction operation, or to indicate a negative numeric value.

## Syntax

```
num.exp - num.exp
```

## Example(s)

Subtracts 1 from the contents of variable x.

```
x = x - 1
```
Negates the contents of z and adds
to the contents of x. The result is placed in x.

```
x = x + (-z)
```
Subtracts the contents of the variable discount.amount from the variable price. Places the result in
the variable amount.

```
amount = price - discount.amount
```
Subtracts the contents of variable discount.amount from the product of unit.cost and qty. The () are used to group precedence are unnecessary
due to default precedence. They are added for program clarity.

```
amount = (unit.cost * qty) - discount.amount
```
This assigns the value, -1, to the
variable counter.

```
counter = -1
```

## See also

- [*= assignment operator](https://d3codex.com/pickbasic-flashbasic/asterisk-equals-assignment-operator/)
- [+ arithmetic operator](https://d3codex.com/pickbasic-flashbasic/plus-arithmetic-operator/)
- [+= assignment operator](https://d3codex.com/pickbasic-flashbasic/plus-equals-assignment-operator/)
- [-= assignment operator](https://d3codex.com/pickbasic-flashbasic/minus-equals-assignment-operator/)
- [/= assignment operator](https://d3codex.com/pickbasic-flashbasic/slash-equals-assignment-operator/)
- [:= assignment operator](https://d3codex.com/pickbasic-flashbasic/colon-equals-assignment-operator/)
- [Arithmetic expressions](https://d3codex.com/pickbasic-flashbasic/arithmetic-expressions/)
- [Arithmetic operators](https://d3codex.com/pickbasic-flashbasic/arithmetic-operators/)
- [Numeric expressions](https://d3codex.com/pickbasic-flashbasic/numeric-expressions/)
- [Precedence](https://d3codex.com/pickbasic-flashbasic/precedence/)
- [precision statement](https://d3codex.com/pickbasic-flashbasic/precision-statement/)
- [Relational operators](https://d3codex.com/pickbasic-flashbasic/relational-operators/)
- [Reserved characters](https://d3codex.com/pickbasic-flashbasic/reserved-characters/)
- [\= assignment operator](https://d3codex.com/pickbasic-flashbasic/backslash-equals-assignment-operator/)

---
Source: https://d3codex.com/pickbasic-flashbasic/minus-arithmetic-operator/ - part of the D3Codex reference.
