Even or odd: Difference between revisions
Content added Content deleted
imported>Tromp (parity in BLC) |
imported>Tromp |
||
Line 1,255: | Line 1,255: | ||
=={{header|Binary Lambda Calculus}}== |
=={{header|Binary Lambda Calculus}}== |
||
In lambda calculus, the |
In lambda calculus, the oddness of a given church numeral n can be computed as n applications of <code>not</code> to <code>false</code>: <code>\n. n (\b\x\y. b y x) (\x\y.y)</code>, which in BLC is |
||
<syntaxhighlight>00 01 01 10 0000000101111010110 000010</syntaxhighlight> |
<syntaxhighlight>00 01 01 10 0000000101111010110 000010</syntaxhighlight> |
||
To compute the evenness, one need only replace <code>false</code> by <code>true</code>, i.e. replace the final 0 bit by 10. |
|||
=={{header|BQN}}== |
=={{header|BQN}}== |