Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: BitAnd[True,False]
Replies: 6   Last Post: Sep 27, 2013 2:37 AM

 Messages: [ Previous | Next ]
 Alan Posts: 95 Registered: 3/29/11
Re: BitAnd[True,False]
Posted: Sep 26, 2013 3:43 AM

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:
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

Date Subject Author
9/26/13 John Fultz
9/26/13 Alan
9/26/13 Sseziwa Mukasa
9/26/13 Ernst H.K. Stelzer
9/27/13 Itai Seggev