Even or odd
FreeLogic@rabbinatix/even-or-odd by Rabbinatixupdated Oct 4, 2026
Says whether a whole number is even or odd.
The remainder of dividing by 2 is 0 for even numbers. Works for negative numbers too.
Shows: Modulo, Equals, Select.
How to use it
Add it to your logic, then add a Call Function step in any logic and pick Even or odd. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.
Inputs
n: Whole number
Outputs
parity: Text
even: Yes / No
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 2 outputs. step 1 of 5
Even or odd
n
Modulo, Operators. 2 inputs, 1 output. step 2 of 5
%
A
B
result
Equals, Operators. 2 inputs, 1 output. step 3 of 5
==
A
B
result
Select, Data. 3 inputs, 1 output. step 4 of 5
Select
condition
if true
if false
value
Return, Input / output. 3 inputs, 0 outputs. step 5 of 5
Return
parity
even
Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.
Examplesrun live against the logic · 2/2 pass
| Passed | Example | Input | Output |
|---|---|---|---|
| Even | {"n":4} | {"parity":"even","even":true} | |
| Negative odd | {"n":-3} | {"parity":"odd","even":false} |
Try it
Versions
In this package
Even or odd (entry)
