Earlier quoted context omitted.
You want to implement your own is-odd in your code - simple, right? isOdd = (x) => x % 2 == 1 Ut oh, your code is broken for negative numbers now since % isn't a true modulo operator... Fine then, isOdd = (x) => x % 2 != 0 Ut oh, your code is broken because isOdd("hi") returns true now... Fine then, isOdd = (x) => if(!isNumber(x)) throw... else return x%2 != 0 Ut oh, your code is now broken because isOdd(2^55+1) retu…
> Ut oh, your code is now broken because isOdd(2^55+1) returns true now... I think you messed up this example. Whether I literally use "2^55" with XOR or replace it with "2*55", that version of isOdd returns false. False for isOdd(58) is obviously correct. (Also thanks C for permanently screwing up the precedence of bitwise operations because you didn't want to break some existing programs in 1972.) False for isOdd(3…
2 to the 55th power is obviously even, so that +1 is obviously odd, but ((2*55) +1) % 2 == 0 in JavaScript.