Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>xor() - bitwise xor of two numbers</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     xor() - bitwise xor of two numbers
  Usage:    xor(<int>,<number>)
  Params:   integer <int> - number to xor, not greater then 65535
            integer <number> number to xor <int> with, not greater
            than 65535
  Returns:  integer equal to the bitwise xor of <int> and <number>

 ---------------------------------- Example ---------------------------------

                 ? xor(1,0)          && prints 0
                 ? xor(1,1)          && prints 0
                 ? xor(0,0)          && prints 1

  Note:     Xoring one value with another will return the 1's
            complement of the two bits at position <n>. If the
            two bits are both zero, than the result is 1, if the
            two bits are 1 and 0, then the result is 0, if the two
            bits are 1 and 1, then the result is 0. eg:

                 parameter = binary value      = dec
                 v1        = 0000000000110101  = 53
                 v2        = 0000000010010100  = 148
                 xor(v1,v2)= 1111111101001010  = 65354

            You can use num2bin() and bin2num() to convert
            binary strings into their decimal equivalents for ease
            when using the binary functions.


See Also: and() or() rol() ror() test() shl() shr()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson