Re: BitAnd[True,False]
- To: mathgroup at smc.vnet.net
- Subject: [mg131739] Re: BitAnd[True,False]
- From: Alan G Isaac <alan.isaac at gmail.com>
- Date: Thu, 26 Sep 2013 03:44:04 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <20130925063645.E297C6A74@smc.vnet.net> <A7EC8DF9-DE87-4369-9DB4-BE13F63B1233@wolfram.com>
On 9/25/2013 4:24 AM, John Fultz wrote:
> I'm not sure why you might have expected this to work. It
> wouldn't occur to me at all that bitwise operations would
> have anything to do with logical truth tables (unless
> those tables were expressed in values of 0 and 1).
Not expect, but rather hope. And why?
Because I would hope bitwise operations would treat
True and False like 1 and 0. (E.g., in Python, True
and False behave this way, since bool is a subtype
of int.)
Let me put it this way:
what else might one intend by BitAnd[True,False]?
To AND values in two binary (True,False) matrices,
I think we must do something like:
MapThread[And, {m1, m2}, 2]
Being able to just BitAnd[m1,m2] would be nicer.
But in any case, thank you for the helpful
explanation of the behavior that puzzled me.
Cheers,
Alan Isaac
- References:
- BitAnd[True,False]
- From: Alan <alan.isaac@gmail.com>
- BitAnd[True,False]