in reply to Boolean operation: (A & B) vs (A * B)

A * B is a numerical multiplication. If the (perl) values of A and B can only be 1 and 0 then this is equivalent to a Boolean AND.

A & B is a bitwise AND. Again, if 1 and 0 are the only values this is also equivalent to a Boolean AND.

Whether or not these expressions are entirely equivalent depends on the restrictions of the values to the binary set {0, 1}.

Replies are listed 'Best First'.
Re^2: Boolean operation: (A & B) vs (A * B)
by LanX (Saint) on Jan 28, 2016 at 13:46 UTC
    > If the (perl) values of A and B can only be 1 and 0 then this is equivalent to a Boolean AND.

    well it's a bit more complicated... 1+1 = 2, see my post Re: Boolean operation: (A & B) vs (A * B)

    Update

    as pointed out neither the OP nor hippo used +, I saw the wider scope ...

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!