Difference between revisions of "Manuals/calci/BITOR"

From ZCubes Wiki
Jump to navigation Jump to search
Line 6: Line 6:
 
== Description ==
 
== Description ==
  
*BITOR() returns the result of bitwise OR operation performed on numeric values.
+
*BITXOR() returns the result of bitwise XOR operation performed on numeric values.
*<math>n1</math> and <math>n2</math> must be in decimal form and greater or equal to '0'.
+
*<math>n1</math> and <math>n2</math> must be greater or equal to '0'.
*Each bit is set to 1 if the corresponding bit is either <math>n1</math> or <math>n2</math> is 1. The bit is set to 0 only if the corresponding bit is 0 in both <math>n1</math> and <math>n2</math>.
+
*In the result, each bit position is 1 if the values of the parameters <math>n1</math> and <math>n2</math> at that bit position are not equal; in other words, one value is 0 and the other is 1.
*If either argument is a non-numeric value, BITOR returns the #VALUE! error value.
+
*If either argument is a non-numeric value, BITXOR returns the #VALUE! error value.
  
 
For Example,
 
For Example,
  
BITOR(1,6) = '''7'''  (The binary representation of 1 is 1, and the binary representation of 6 is 110. Result is returned as 7 i.e 111.
+
BITXOR(1,6) = '''7'''   
  
BITOR(true, true) =  '''1''' (Bit AND value of 'true' is '1'. Hence result is 1.)
+
BITXOR(true, true) =  '''0'''  
  
  
 
== Examples ==
 
== Examples ==
  
#=BITOR(3,5) = 7
+
#=BITXOR(3,5) = 6
#=BITOR(17,-22) = -5
+
#=BITXOR(17,-22) = -5
#=BITOR(-9,-3) = -1
+
#=BITXOR(-9,-3) = 10
#=BITOR(0.5,0.1) = 0
+
#=BITXOR(0.5,0.1) = 0
#=BITOR(12, 7) = 15
+
#=BITXOR(12, 7) = 11
  
  
Line 34: Line 34:
 
==See Also==
 
==See Also==
  
 +
*[[Manuals/calci/BITOR | BITOR]]
 
*[[Manuals/calci/BITAND | BITAND]]
 
*[[Manuals/calci/BITAND | BITAND]]
 
*[[Manuals/calci/BITNOT  | BITNOT]]
 
*[[Manuals/calci/BITNOT  | BITNOT]]

Revision as of 05:06, 4 May 2017

BITXOR(n1,n2)


  • where and specify the numeric values on which the bitwise XOR operation is to be performed.


Description

  • BITXOR() returns the result of bitwise XOR operation performed on numeric values.
  • and must be greater or equal to '0'.
  • In the result, each bit position is 1 if the values of the parameters and at that bit position are not equal; in other words, one value is 0 and the other is 1.
  • If either argument is a non-numeric value, BITXOR returns the #VALUE! error value.

For Example,

BITXOR(1,6) = 7

BITXOR(true, true) = 0


Examples

  1. =BITXOR(3,5) = 6
  2. =BITXOR(17,-22) = -5
  3. =BITXOR(-9,-3) = 10
  4. =BITXOR(0.5,0.1) = 0
  5. =BITXOR(12, 7) = 11


Related Videos

BITWISE OPERATORS


See Also


References