Re: Working with binaries
- To: mathgroup at smc.vnet.net
- Subject: [mg48018] Re: Working with binaries
- From: Luca <luca at nospam.it>
- Date: Fri, 7 May 2004 04:29:37 -0400 (EDT)
- References: <c77u1i$2rq$1@smc.vnet.net> <c7am4h$he6$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Jean-Michel Collard wrote: > Luca wrote: >> Is it possible with mathematica to work with binaries? I did it in >> another system by typing: OutputBase := Binary. I was also trying to find >> the function NOT, i.e. that function which gives: >> >> !1 = 0 >> !0 = 1 >> >> I found in the help BitNot, but BitNot[1] gives me -2. >> Thanks for any advice. >> >> Luca >> > > the mathematica book : > > BitNot[n] returns -1-n > > JM Yes, but there's also written: BitNot[n] turns ones into zeros and vice versa in the binary representation of n. Luca