torkell: (Default)
Thomas ([personal profile] torkell) wrote2006-01-23 12:46 am
Entry tags:

(no subject)

Memo to self: a bitwise OR is not the same as a logical OR.

(that bug took me the past hour to track down)

[identity profile] olego.livejournal.com 2006-01-25 01:15 am (UTC)(link)
Interestingly, yesterday I tried AND to turn a bit on, and XOR to turn it off. *smacks forehead*

[identity profile] olego.livejournal.com 2006-01-25 08:19 pm (UTC)(link)
Actually, the XOR worked fine because it followed an IF:

if (bit is set)
xor
else
and

I couldn't understand why the and wasn't working. And then it struck me.

And then I and ~bitmask. :-)