# Arithmetic operators

Arithmetic operators add, subtract, multiply, and divide
numeric operands in arithmetic expressions.

The simplest arithmetic expression is a single numeric
constant, variable, or function. A simple arithmetic expression can
combine two operands using an arithmetic operator. More complicated
arithmetic expressions are formed by combining simple expressions
using arithmetic operators.

If a string value is used in an
arithmetic expression, the BASIC run-time package attempts to convert
it into a number. If it fails, 0 is used and a warning displays.

If a string value containing only numeric characters is used in
an arithmetic expression, it is evaluated as a decimal number. If
a string value containing nonnumeric characters is used in an arithmetic
expression, a warning message displays and zero is assumed for the
string value.

## Example(s)

```
total = (invoice.amount - discount) + tax
```

## See also

- [* arithmetic operator](https://d3codex.com/pickbasic-flashbasic/asterisk-arithmetic-operator/)
- [*= 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/)
- [- arithmetic operator](https://d3codex.com/pickbasic-flashbasic/minus-arithmetic-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/)
- [Precedence](https://d3codex.com/pickbasic-flashbasic/precedence/)
- [precision statement](https://d3codex.com/pickbasic-flashbasic/precision-statement/)
- [\= assignment operator](https://d3codex.com/pickbasic-flashbasic/backslash-equals-assignment-operator/)

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