Skip to content

The - Command

Command Summary Command Syntax Calculator Compatibility Token Size
Returns the difference of two numbers. value1 - value2 This command works on all calculators. 1 byte

Press the [-] key to paste -.

The - Command

The - operator subtracts two numbers, variables, or expressions. Order of operations dictates that it's calculated after * and /, and at the same time as +.

The - operator can also be used on lists and matrices. For the most part, it behaves in the intuitive way, distributing the operation over each element. However, subtracting a number from a matrix (or a matrix from a number) behaves differently: the number is only subtracted along the main diagonal of the matrix. For "normal" subtraction that applies to every element of the matrix, see .-.

:1-1
           0
:5→x
:2-3x
           -13
:[1,2;3,4]-100
           [-99  2]
           [3  -96]
  • + (add)
  • * (multiply)
  • / (divide)

See Also

Authors: KG