Ad
  • Default User Avatar

    Yes. bitwise-or of the modulo(remainder). It is only zero if both modulos are zero.
    When using it on bools you have to be a bit careful, as (1 | 2) is 0011, and that is stored in boolean. true is 0001, so while (1 | 2) evalutes to true, it's not equal to true in some way. Here it's fine, but be aware. Negating with ! (boolean not) "normalizes" it to 0000 or 0001 though. ~ would be the bitwise not.

    bitwise-or may be faster as it does not branch (both sides are always evaluated), as opposed to boolean or. But don't rely on that.