<< Support Functions Support Functions lowdisc_bithi1 >>

Low Discrepancy >> Low Discrepancy > Support Functions > lowdisc_bitand

lowdisc_bitand

Bitwise AND.

Calling Sequence

z = lowdisc_bitand(x,y)

Parameters

x :

a m-by-n matrix of doubles, integer value, positive

y :

a m-by-n matrix of doubles, integer value, positive

z :

a m-by-n matrix of doubles, integer value, positive

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 operator of binary representation 86 and 91
// so the decimal number corresponding to the AND operator
// 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

<< Support Functions Support Functions lowdisc_bithi1 >>