Alternatively called subtraction, subtract is a math operation that takes the value of one number from another number. An example of addition is 10 - 4 = 6. On a computer, you can subtract numbers using a calculator or spreadsheet program and the hyphen (-) or subtraction symbol.
Subtraction operator
In many programming languages, the subtraction operator ( -= ) can be used as a way to add to a previous value. For example, in the Perl code below, the $example variable is first set to a value of “4”. The next line uses the subtraction operator to subtract “3” from the variable.
The computer processor ALU (arithmetic logic unit) performs the subtract operation.
$example = 4; $example -= 3; print “Total = $example”;
When the script above is executed, the computer would print out “Total = 1” to the screen.
Add, ALU, Arithmetic, Create, Divide, Multiply, Programming terms
Related information
- Help, examples, and information on Excel formulas.