Within: Difference between revisions
Content added Content deleted
(add within primtive) |
("Paragraph cleanup") |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
The '''within''' primitive checks if an integer/character <code>i</code> is in the range defined by a two element vector <code>a</code>. |
The '''within''' primitive checks if an integer/character <code>i</code> is in the range defined by a two element vector <code>a</code>. |
||
== K7 == |
|||
In K7+, the range is inclusive of first element and exclusive of the second element. |
|||
<pre> |
<pre> |
||
Line 15: | Line 16: | ||
0 |
0 |
||
</pre> |
</pre> |
||
== K4 == |
|||
In K4<ref>https://code.kx.com/q/ref/within/</ref>, the range is inclusive of both the first and the second element. |
|||
== References == |
|||
[[Category:Verbs]] |
|||
[[Category:Named verbs]] |
|||
[[Category:Primitives]] |
Latest revision as of 07:59, 9 July 2022
Within
i within a
The within primitive checks if an integer/character i
is in the range defined by a two element vector a
.
K7[edit]
In K7+, the range is inclusive of first element and exclusive of the second element.
1 within 1 3 1 3 within 1 3 0 "a" within "az" 1 "a" within "cz" 0
K4[edit]
In K4[1], the range is inclusive of both the first and the second element.