Negate - kevinlawler/kona GitHub Wiki

-x is the negative of x. Equivalent to 0-x.

Care must be taken to avoid confusion between the two expressions -2 and - 2. They both produce the same result but there is a difference in their meaning, the former is the representation of a negative number with the - being an indivisible part of the number whereas the latter is the application of the function negate to the integer 2. (When ambiguous, it will parse as whichever token is longer, AKA “maximal munch”).

Negate is self-inverse: x ~ --x

  -1 2 3
-1 2 3

  - 1 2 3
-1 -2 -3

  -:1 -2.4 3.2
-1 2.4 -3.2

  a ~ --a:-3 4 -5
1
⚠️ **GitHub.com Fallback** ⚠️