Wrong bitwise xor in PS7?

I played around with the bit-operators in PS7 and came upon a strange result:

001000000010 should become 001000000000 if xor-ed with 00000010, or am I getting sth wrong here?

Hi, welcome to the forum :wave:

When posting code, please post it as text, formatted as code, not as a screenshot. It makes it much easier for us to copy and paste for testing.
How to format code on PowerShell.org

For your first value, you’ve used 0B to specify a binary literal but you haven’t done that for your second one so it’s treating it as decimal 10, or 0B00001010.

Ok, thanks a lot!
Best regards

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.