Comparison: Difference between revisions
Content added Content deleted
(add equal sign to primitive infobox) |
(atomicity) |
||
Line 1:
{{primitive|x<y<br>x>y<br>x=y}}
The comparison primitives in K are <code><</code>, <code>></code> and <code>=</code> which stand for lesser than, greater than and equal to respectively. Comparisons are [[atomicity|fully atomic]].
The comparison functions always give a boolean value, 1 or 0.
|
Revision as of 15:14, 15 July 2021
Comparison
x<y
x>y
x=y
x>y
x=y
The comparison primitives in K are <
, >
and =
which stand for lesser than, greater than and equal to respectively. Comparisons are fully atomic.
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 2 56 1 = (2;4;"a") 1 0 0