From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,255a2533fba89f5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-16 12:51:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!news-out.worldnet.att.net.MISMATCH!wn3feed!wn2feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Calculate and set Parity References: <3D8629D3.2040603@acm.org> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1032205901 12.234.13.56 (Mon, 16 Sep 2002 19:51:41 GMT) NNTP-Posting-Date: Mon, 16 Sep 2002 19:51:41 GMT Organization: AT&T Broadband Date: Mon, 16 Sep 2002 19:51:41 GMT Xref: archiver1.google.com comp.lang.ada:29045 Date: 2002-09-16T19:51:41+00:00 List-Id: > array of Boolean seems like a good way to go. You then simply add up the > Boolean'Pos of each element and determine if the result is even or odd > ("rem 2"). You could do an unchecked conversion to a 16-bit modular type > and use shifts and masks to isolate the individual bits, but using > Booleans seems simpler. If speed is a consideration, and memory is available, convert to an array of a 16 or an 8 bit type and look up the parity of each element in a lookup table, then XOR the parities together.