1function C = bitxor (A, B, assumedtype)
2%BITXOR bitwise XOR.
3% C = bitxor (A,B) is the bitwise XOR of A and B.  If A and B are
4% matrices, the pattern of C is the set union of A and B.  If one of A or
5% B is a nonzero scalar, the scalar is expanded into a full matrix the
6% size of the other matrix, and the result is a full matrix.
7%
8% With a third parameter, C = bitxor (A,B,assumedtype) provides a data
9% type to convert A and B to if they are floating-point types.  If A or B
10% already have integer types, then they are not modified.  Otherwise, A or
11% B are converted to assumedtype, which can be 'int8', 'int16', 'int32',
12% 'int64', 'uint8', 'uint16', 'uint32' or 'uint64'.  The default is
13% 'uint64'.
14%
15% Example:
16%
17%   A = GrB (magic (4), 'uint8')
18%   B = GrB (13 * eye (4), 'uint8') ;
19%   B (3,4) = 107
20%   C = bitxor (A, B)
21%   fprintf ('\nA: ') ; fprintf ('%3x ', A) ; fprintf ('\n') ;
22%   fprintf ('\nB: ') ; fprintf ('%3x ', B) ; fprintf ('\n') ;
23%   fprintf ('\nC: ') ; fprintf ('%3x ', C) ; fprintf ('\n') ;
24%   % in MATLAB:
25%   C2 = bitxor (uint8 (A), uint8 (B))
26%   isequal (C2, C)
27%
28% See also GrB/bitor, GrB/bitand, GrB/bitcmp, GrB/bitshift, GrB/bitget,
29% GrB/bitset, GrB/bitclr.
30
31% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
32% SPDX-License-Identifier: GPL-3.0-or-later
33
34if (nargin < 3)
35    assumedtype = 'uint64' ;
36end
37
38C = GrB (gb_bitwise ('bitxor', A, B, assumedtype)) ;
39
40