Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15546 > unrolled thread

Re: BitAnd[True,False]

Started by"Ernst H.K. Stelzer" <ernst.stelzer@physikalischebiologie.de>
First post2013-09-26 07:49 +0000
Last post2013-09-26 07:49 +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.


Contents

  Re: BitAnd[True,False] "Ernst H.K. Stelzer" <ernst.stelzer@physikalischebiologie.de> - 2013-09-26 07:49 +0000

#15546 — Re: BitAnd[True,False]

From"Ernst H.K. Stelzer" <ernst.stelzer@physikalischebiologie.de>
Date2013-09-26 07:49 +0000
SubjectRe: BitAnd[True,False]
Message-ID<l20oui$b75$1@smc.vnet.net>
BooleanTable[{p, q, And[p, q]}, {p, q}] // TableForm

True	True	True
True	False	False
False	True	False
False	False	False

BitAnd operates on the bits in an integer

{#1, #2, BitAnd[#1, #2]} & @@@ Tuples[{0, 1}, {2}] // TableForm

0	0	0
0	1	0
1	0	0
1	1	1


Greetings

    Ernst


-----Original Message-----
From: Alan [mailto:alan.isaac@gmail.com]
Sent: Wednesday, 25 September, 2013 08:37 AM
Subject: BitAnd[True,False]

I'd hoped BitAnd would work on Boolean Lists so I gave it a try.  If it had simply failed completely I'd be disappointed but would understand.  But oddly, it half succeeds.  Why? BitOr fails the same way, and BitNot always fails.

I just want to understand these results.  I know there are ways to get the output I want.

Thanks,
Alan Isaac
(using Mathematica 9)

In[77]:= BooleanTable[{p,q,BitAnd[p,q]},{p,q}]//TableForm
Out[77]//TableForm=
True	True	True
True	False	BitAnd[False,True]
False	True	BitAnd[False,True]
False	False	False


[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web