- Operator

Computes the difference of two numbers or the negative of a number.

Syntax

Binary form
expression1 - expression2
Unary form
- expression1

Parts

expression1
Required numeric expression
expression2
Required in the binary form; a numeric expression

Remarks

The binary - operator subtracts the value of expression2 from the value of expression1 and returns the difference.

The unary - operator negates the value of expression1. If the value is positive, it returns a negative value. If the value is negative, it returns a positive value. If the value is zero, it returns zero.

Examples

See also