Negate

From The K Language Wiki
Revision as of 13:26, 8 July 2021 by Razetime (talk | contribs) (add negate page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The negate function, generally denoted by -, is used for getting the additive inverse of a number in K(numeric negation).


The negate primitive is right atomic.

 -[3]
-3

 -(9;8;7)
-9 -8 -7

 -(9;(8;-56);(7;-65))
(-9
 -8 56
 -7 65)