|looks like semantics to me, how to define "determine".|
computers generally use either integer 255 (-1) or 0 as "not".
but that's not math, that's computers (boolean algebra).
(warning, i know very little of which i speak, I'm floating this as a means of being flamed / corrected into knowledge!!!)
in an algebraic formula, you would alter the base by the modulo of two, (i think), by multiplication, so that zero gives the number and 1 gives zero, or the opposite (easily arranged)
here is test:
outp=outp*(num % 2)
will yield unaltered output if num is odd, or zero if num is even.
I wondered about this: mathematically to make all integers not zero = 1, (in algbraic formula), and failed, but i haven't googled it, maybe it's simple! Division by zero craps it every time. ie: boil every number down to either 0 or 1. zero is zero, not zero is one.
with computers, you can fudge it because either zero is "yes" , not-zero is "no" or not-zero is "yes" and opposite.
(oops, coffee break! crossed posts in mail!)