$xor: Difference between revisions

From Scriptwiki
Jump to navigation Jump to search
Aca20031 (talk | contribs)
No edit summary
 
Daveoh (talk | contribs)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Performs a bit-wise EXClUSIVE OR comparison against two numbers
Performs a bit-wise EXCLUSIVE OR comparison against two numbers
  $xor(number 1, number 2)
  $xor(number 1, number 2)


Line 9: Line 9:
  00000110
  00000110


Leaving the bits which are in 5 '''OR BUT NOT BOTH''' 6
Leaving the bits which are in either 5 '''OR''' 6, '''BUT NOT BOTH'''.


  Returns: 3 (00000011)
  Returns: 3 (00000011)
[[Category:Bitwise Identifiers]]
[[Category:Bitwise Identifiers]]

Latest revision as of 18:49, 9 May 2008

Performs a bit-wise EXCLUSIVE OR comparison against two numbers

$xor(number 1, number 2)

Examples

$xor(5,6)

Binary values of each:

00000101
00000110

Leaving the bits which are in either 5 OR 6, BUT NOT BOTH.

Returns: 3 (00000011)