BitXOr

Revision as of 19:17, 31 December 2015 by Lchrisman (talk | contribs) (Created page with "category:Bit functions ''new in Analytica 4.7'' == BitXOr( x'', I'' ) == Returns the bitwise exclusive-OR (XOR) of the integer portions of an array of numbers. Each...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


new in Analytica 4.7

BitXOr( x, I )

Returns the bitwise exclusive-OR (XOR) of the integer portions of an array of numbers. Each bit in the result is on only if the corresponding bit is on in an odd number of integers in «x» along index «I». «I» can be omitted when taking the bitwise XOR across the Implicit dimension.

Each integer may have up to 64 bits.

Examples

To find the bitwise XOR of three numbers, the numbers can be listed in brackets (the implicit index) and the index parameter omitted.

BitXOr( [23, 29, 25] ) → 19

This is more obvious when we write these same numbers in binary notation:

BitXOr( [0b10111, 0b11101, 0b11001] ) → 19 { note: 17 = 0b10011 }

Suppose x is the following 2-D array of integers

BitAnd x.png

which is shown here in binary notation

Binary x BitAnd.png

then

BitXOr(x,I)BitXOr result1d.png
= BitXOr result1.png
BitXOr(x,J)BitXOr result2.png

See Also

Comments


You are not allowed to post comments.