Not really but neither does it for bit_or or bit_and and I kinda copied from those :P

Should I limit the arguments for all bit_and, bit_or and bit_xor so they make sense?

I'm also not sure about the magic that is optimizations but I'll just try and do what you said and learn ;)