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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e8b01e86b2d0a470 X-Google-Attributes: gid103376,public From: robert_dewar@my-dejanews.com Subject: Re: how to do bit-wise operation on none modular types? Date: 1999/03/04 Message-ID: <7bkr0s$a7s$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 450995199 References: <7bjjck$25t7@news1.newsguy.com> X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) X-Http-Proxy: 1.0 x16.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Mar 04 02:26:44 1999 GMT Newsgroups: comp.lang.ada Date: 1999-03-04T00:00:00+00:00 List-Id: In article , stt@houdini.camb.inmet.com (Tucker Taft) wrote: > Samuel Mize (smize@imagin.net) wrote: > > Personally, I find "X mod 16#10000#" *more* clear than "X > and 16#FFFF#" because bitwise "and" is working on the > representation, whereas "mod" is working on the value, > but vive la difference. I could not begin to choose between these two without knowing what the data in question represents. If it is indeed logically an integer, then the first form is better, but if in fact the integer is really a string of bits, then the AND is clearer. Yes, you may say that the string of bits would better be represented as a packed boolean array, but if you are interfacing to some foreign environment which thinks of it as an integer, it is actually safer to map it into an integer. The trouble with the packed boolean array is that you do NOT know the mapping of subscripts in the array to bit positions in the integer. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own