🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #1191

Re: Bitwise EXOR

#1191
From: Stephen Russell
Date: Sun, 30 Sep 1990 15:05
18 lines
1016 bytes
Herman Stevens asks:
>I fail to see how I can do a bitwise EXOR, something you
>can easily write in C as :
>
>         tmpbuf[i] = inbuf[i]^key[kp]
>
>Can someone help me on this ?

It ain't as simple as in C (but then neither are bit-ands and ors). Try
using the symmetric set difference operator by casting. Something
like this might work:

	tmpbuf[i] := CARDINAL(BITSET(inbuf[i]) / BITSET(key[kp]))

You may have to fiddle with the appropriate set types to get this past
the compiler, but hopefully you get the idea.

Cheers
Technical Details
Message-ID: <1230@cluster.cs.su.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!samsung!munnari.oz.au!metro!cluster!steve

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!samsung!munnari.oz.au!metro!cluster!steve
From: steve@cs.su.oz (Stephen Russell)
Newsgroups: comp.lang.modula2
Subject: Re: Bitwise EXOR
Message-ID: <1230@cluster.cs.su.oz.au>
Date: 30 Sep 90 15:05:23 GMT
Sender: news@cluster.cs.su.oz.au
Reply-To: steve@cluster.cs.su.oz (Stephen Russell)
Organization: Basser Dept of Computer Science, University of Sydney, Australia
Lines: 18