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=0.6 required=5.0 tests=BAYES_00,FROM_WORDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1eda8da8a6221ea7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-18 13:36:04 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!news-stob.telia.net!news-sto.telia.net!194.22.194.4.MISMATCH!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: "Sune Falck" Newsgroups: comp.lang.ada References: <9j2p76$6is$1@fang.dsto.defence.gov.au> <192e1f87.0107180742.4e2e83df@posting.google.com> Subject: Re: bitwise operations in Ada95 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Wed, 18 Jul 2001 20:17:28 GMT NNTP-Posting-Host: 62.20.219.120 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 995487448 62.20.219.120 (Wed, 18 Jul 2001 22:17:28 CEST) NNTP-Posting-Date: Wed, 18 Jul 2001 22:17:28 CEST Organization: Telia Internet Xref: archiver1.google.com comp.lang.ada:10197 Date: 2001-07-18T20:17:28+00:00 List-Id: "Aquaman" wrote in message news:192e1f87.0107180742.4e2e83df@posting.google.com... > My question would be for a way to do bit shifting operations (vs. & |) > so for example shift left and shift right for use in mathmatical mult and div > opperations > > thanks for any info The standard package Interfaces contains the following shift and rotate functions for all defined modular types. >From the Ada 95 standard anexx B.2 package Interfaces is ... type Unsigned_n is mod 2**n; function Shift_Left (Value : Unsigned_n; Amount : Natural) return Unsigned_n; function Shift_Right (Value : Unsigned_n; Amount : Natural) return Unsigned_n; function Shift_Right_Arithmetic (Value : Unsigned_n; Amount : Natural) return Unsigned_n; function Rotate_Left (Value : Unsigned_n; Amount : Natural) return Unsigned_n; function Rotate_Right (Value : Unsigned_n; Amount : Natural) return Unsigned_n; ... end Interfaces; Sune Falck