3 ms·
It's heretic and beside the point, but: bool odd(uint n){return n&1;} bool even(uint n){ return !odd(n);} I can't help but think in terms of classic CPU.
by actionfromafar 4y ago
It's heretic and beside the point, but:
bool odd(uint n){return n&1;} bool even(uint n){ return !odd(n);}
I can't help but think in terms of classic CPU.
- Joker_vD 4y agofun odd (n: Uint32) -> Bool = let Uint32(n0, _, _, _) = n in let Byte(b0, _, _, _, _, _, _, _) = n0 in b0 Who needs hardware support for integers anyway? If you want a two-complement arithmetic, you can build it yourself (although presumably it'll be in the standard library).