Difference between revisions of "BitXor"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>bitXor</c> treats its arguments as integers, and computes the bitwise `xor`: each bit in the result is set only if the corresponding bit is set in exactly one (not zero or...")
 
m (Show the correct function call.)
 
(2 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
! Parameter Name !! Default Value !! Meaning
 
! Parameter Name !! Default Value !! Meaning
 
|-
 
|-
| ''i'' || number, default 0 || first integer arument
+
| ''i'' || number, default 0 || first integer argument
 
|-
 
|-
| ''j'' || number, default 0 || second integer arument
+
| ''j'' || number, default 0 || second integer argument
 
|}
 
|}
  
=== Usage Notes ===
 
<c>funcname</c> may be called either as a global method, passing the sequence or map as an argument; or as a member function (defined on [[list]], [[string]], and [[map]]) using [[dot syntax]], with no arguments.
 
  
 
== Example ==
 
== Example ==
  
<ms>bitAnd(14, 7) // returns 9</ms>
+
<ms>bitXor(14, 7) // returns 9</ms>
  
 
[[Category:Intrinsic Functions]]
 
[[Category:Intrinsic Functions]]
 
[[Category:Numeric Functions]]
 
[[Category:Numeric Functions]]

Latest revision as of 14:46, 11 November 2023

bitXor treats its arguments as integers, and computes the bitwise `xor`: each bit in the result is set only if the corresponding bit is set in exactly one (not zero or both) of the arguments.

See also: bitAnd; bitOr

Arguments

Parameter Name Default Value Meaning
i number, default 0 first integer argument
j number, default 0 second integer argument


Example

bitXor(14, 7)	// returns 9