🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #1196

Re: Bitwise EXOR

#1196
From: Anthon Pang
Date: Sun, 30 Sep 1990 05:04
29 lines
1221 bytes
steve@cs.su.oz writes:
> 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]))

preston@titan.rice.edu writes:
> Well, if you want to fiddle bits, use BITSETs in the first place.
> Then, assuming you've declared all your variables as arrays
> of BITSET, you simply write
> 
>         tmpbuf[i] := inbuf[i] / key[kp]
> 
> I think "symmetric set difference" is a rather unhelpful name,
> but perhaps it's more common in Europe.

John.Matthews@comp.vuw.ac.nz writes:
> I have an idea that in Modula-2 speak, XOR is represented as
> Symmetrical Difference (of set types).
> 
> Convert whatever to a set type, eg BitSet, then
> 
> a = b XOR c
>  is equal to
> 
> a = b / c;

Gee...I've been outnumbered 3 to 1...I guess I was wrong :)
Technical Details
Message-ID: <3365@mindlink.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!van-bc!rsoft!mindlink!a665

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!van-bc!rsoft!mindlink!a665
From: a665@mindlink.UUCP (Anthon Pang)
Newsgroups: comp.lang.modula2
Subject: Re: Bitwise EXOR
Message-ID: <3365@mindlink.UUCP>
Date: 30 Sep 90 05:04:17 GMT
Organization: MIND LINK! - British Columbia, Canada
Lines: 29