Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15540 > unrolled thread
| Started by | Alan G Isaac <alan.isaac@gmail.com> |
|---|---|
| First post | 2013-09-26 07:43 +0000 |
| Last post | 2013-09-26 07:43 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: BitAnd[True,False] Alan G Isaac <alan.isaac@gmail.com> - 2013-09-26 07:43 +0000
| From | Alan G Isaac <alan.isaac@gmail.com> |
|---|---|
| Date | 2013-09-26 07:43 +0000 |
| Subject | Re: BitAnd[True,False] |
| Message-ID | <l20ojs$b1l$1@smc.vnet.net> |
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
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web