<< lowdisc_bary Support Functions lowdisc_bithi1 >>

Low Discrepancy Toolbox >> Low Discrepancy Toolbox > Support Functions > lowdisc_bitand

lowdisc_bitand

Bitwise AND.

Calling Sequence

z = lowdisc_bitand(x,y)

Parameters

x, y :

scalars/vectors/matices/hypermatices of positives integers, x and y must have the same size

z :

scalar/vector/matrix/hypermatice

Description

Given x,y two positives integers this function returns the decimal number whose the binary form is the AND of the binary representations of x and y. If dimension of x (and y) is superior than 1 then z(i) is equal to bitand(x(i),y(i)).

Examples

// example 1 :
// '1010110' : is the binary representation of 86
// '1011011' : is the binary representation of 91
// '1010010' : is the binary representation for the AND of binary representation 86 and 91
// so the decimal number corresponding to the AND  applied to binary forms 86 and 91 is : 82
x=86;
lowdisc_dec2bin(x)
y=91;
lowdisc_dec2bin(y)
z=lowdisc_bitand(x,y)
lowdisc_dec2bin(z)
// example 2 : the function is vectorized
x=[12,45];
y=[25,49];
z=lowdisc_bitand(x,y)

Authors

<< lowdisc_bary Support Functions lowdisc_bithi1 >>