switch (v) { case: 0,2,4,8,…: return EVEN; case: 1,3,5,7,…: return ODD; default: return IDK; }
processing the whole number is absurd
reply
You know, to save the performance cost of processing the input as a string, and chomping off all but the last character.
All you need is the final binary digit, which incidentally is the most optimal codegen, `v & 1`.