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,fb4f2a91d58d3a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-08 17:01:27 PST Path: supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!newsfeed.direct.ca!look.ca!netnews.com!news-xfer.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!POSTED.monger.newsread.com!not-for-mail Message-ID: <39B97FE3.3A0129B5@telepath.com> From: Ted Dennison X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en,pdf MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Bit operations in Ada (one's complements and sum) References: <8pbt1a$vo8$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 09 Sep 2000 00:01:01 GMT NNTP-Posting-Host: 38.195.186.125 X-Complaints-To: Abuse Role , We Care X-Trace: monger.newsread.com 968457661 38.195.186.125 (Fri, 08 Sep 2000 20:01:01 EDT) NNTP-Posting-Date: Fri, 08 Sep 2000 20:01:01 EDT Organization: Telepath Systems (telepath.com) Xref: supernews.google.com comp.lang.ada:551 Date: 2000-09-09T00:01:01+00:00 List-Id: ebresie@usa.net wrote: > I am curious if there exists either built in or already developed > somewhere, a bit manipulation package. > > I am trying to have 16-bit numbers that are made into one's complement > and have one's complement summation occur with the values. One's complement is just a "not" operation. You won't find a package to do that, because it is too trivial of an operation for someone to make an entire package out of. You just use the "not" operator on a packed array of booleans or on a modular integer. Some examples of this for unpacked arrays of boolean (aka: "Sets") are up on AdaPower at http://www.adapower.com/lang/sets.html . But if you would like to perform math operations on the same data without converting it, modular integers would probably be better for you. -- T.E.D. Home - mailto:dennison@telepath.com Work - mailto:dennison@ssd.fsi.com WWW - http://www.telepath.com/dennison/Ted/TED.html ICQ - 10545591