"Wolfgang Draxinger" <wdraxinger at darkstargames.de> wrote in message news:dvi5gv$qtg$1 at digitaldaemon.com... > These set functions won't work if b==0, since it's just an OR. > What's needed is > > BITS = (BITS & ~(1<<n)) | b ? 1<<n : 0 ; You're right.