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: fraser@nospam.com Subject: Re: how to do bit-wise operation on none modular types? Date: 1999/03/04 Message-ID: <920576142.710.15@news.remarQ.com>#1/1 X-Deja-AN: 451264519 References: <7bjjck$25t7@news1.newsguy.com> <36de1ede.43977585@news.pacbell.net> X-Complaints-To: newsabuse@remarQ.com X-Trace: 920576142.710.15 KZBGBQC4S164892E1C usenet1.supernews.com Organization: Vegetarian Ada Programmers NNTP-Posting-Date: Thu, 04 Mar 1999 19:35:42 GMT Newsgroups: comp.lang.ada Originator: fraser@titanic Date: 1999-03-04T00:00:00+00:00 List-Id: I nearly cried when tmoran@bix.com said: >>find "X mod 16#10000#" *more* clear than "X and 16#FFFF#" >but not easily generalizable to "X and 16#FF7F#" Quite true, which is why one should choose the appropriate tool for whatever one happens to be doing: bit extraction uses Boolean operators, modular arithmetic doesn't. There you go. The difference between extracting the bottom eight bits and doing arithmetic modulo 256 can be subtle of course. Fraser.