not

From The K Language Wiki
Revision as of 06:42, 9 July 2022 by Promovicz (talk | contribs) ("Better category ordering, add redirects to categories, fix pseudo-adverb categories")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Not
~x

The not function, generally denoted by ~, gives the logical negation of an atom in K.

The not primitive is right atomic.

For numbers, returns 0 for nonzero numbers, and 1 if zero. characters also behave as integers.

 ~1 2 0
0 0 1

 ~"sadasd"
0 0 0 0 0 0