comparison

From The K Language Wiki
Revision as of 07:47, 15 July 2021 by Razetime (talk | contribs) (add comparison page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Comparison
x<y
x>y

The comparison primitives in K are < and > which stand for lesser and greater than respectively.

character comparison is done via ASCII codes/UTF-8 code points, based on the implementation.

The comparison functions always give a boolean value, 1 or 0.

 1 2 3 < 3 1 5
1 0 1

 "abc" > "!c "
1 0 1