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-Thread: 103376,553a6b79b2471571 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s71.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How do you bitwise operations in Ada '83 and '95 References: <1153244316.853254.291560@m79g2000cwm.googlegroups.com> <1153248800.834457.183940@p79g2000cwp.googlegroups.com> <1153258362.266358.15200@h48g2000cwc.googlegroups.com> <1153281313.491512.88760@75g2000cwc.googlegroups.com> <1153314304.534739.178430@75g2000cwc.googlegroups.com> In-Reply-To: <1153314304.534739.178430@75g2000cwc.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.176 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s71 1153338223 12.201.97.176 (Wed, 19 Jul 2006 19:43:43 GMT) NNTP-Posting-Date: Wed, 19 Jul 2006 19:43:43 GMT Date: Wed, 19 Jul 2006 19:43:43 GMT Xref: g2news2.google.com comp.lang.ada:5823 Date: 2006-07-19T19:43:43+00:00 List-Id: jimmaureenrogers@worldnet.att.net wrote: > > Here you will note that the algorithm is the same as the > Ada version. The bit-wise operations in the nsieve function > are expressed in the manner you described. According to > your analysis, if the algorithm is the same and the results > are the same, the programs are the same. Logic tells me, > therefore, that accessing individual bits of > contiguous storage through an array of boolean in Ada is > a bit-wise operation just as the combination of AND, OR and > shift operations used in the C program. The algorithm is the same. The levels of abstraction differ. The Ada abstraction of a packed array of Boolean is higher level than accessing individual bits in an unsigned integer but lower level than a set abstraction. To me, using a set abstraction (that is implemented using bitwise operations) is not using bitwise operations; perhaps you would would disagree. Similarly, a compiler probably implements indexing a packed array of Boolean with shift and mask operations, but using such an indexing operation is not a bitwise operation. -- Jeff Carter "People called Romanes, they go the house?" Monty Python's Life of Brian 79