Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: BitAnd[True,False]

  • To: mathgroup at
  • Subject: [mg131740] Re: BitAnd[True,False]
  • From: "Ernst H.K. Stelzer" <ernst.stelzer at>
  • Date: Thu, 26 Sep 2013 03:44:24 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <>

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



-----Original Message-----
From: Alan [mailto:alan.isaac at]
Sent: Wednesday, 25 September, 2013 08:37 AM
To: mathgroup at
Subject: [mg131740] 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.

Alan Isaac
(using Mathematica 9)

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

  • Prev by Date: Re: BitAnd[True,False]
  • Next by Date: Helping people on the internet -- was: Re: a simple question
  • Previous by thread: Re: BitAnd[True,False]
  • Next by thread: Re: BitAnd[True,False]