Even or odd: Difference between revisions
Content added Content deleted
(→UNIX Shell: simplify) |
(→dc: add) |
||
Line 1,624: | Line 1,624: | ||
4 0 0 0 |
4 0 0 0 |
||
5 1 1 1</pre> |
5 1 1 1</pre> |
||
=={{header|dc}}== |
|||
This macro expects an integer on the stack, pops it, and pushes 1 if it is odd, or 0 if it is even (independently from the precision currently set). |
|||
<syntaxhighlight lang="dc">[K Sk 0 k 2 % Lk k]</syntaxhighlight> |
|||
=={{header|DCL}}== |
=={{header|DCL}}== |