Bitwise Operators

version 1 by Bart Massey

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - XOR Phrases (for Z-machine only)

    [ http://www.firthworks.com/roger/informfaq/tt.html#2 ]

    Include (-
    [ XOR a b;
    return (a | b) & ~(a & b);
    ]; -).

    To bit-xor (A - a number) into (B - an existing number variable):
        (- {B} = (XOR({A}, {B}); -)

    To decide what number is (A - a number) bit-xor (B - a number):
        (- XOR({A}, {B}) -).