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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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!news3.google.com!news.glorb.com!proxad.net!cleanfeed3-a.proxad.net!nnrp10-1.free.fr!not-for-mail Return-Path: Mime-Version: 1.0 (Apple Message framework v752.2) References: <9315684D-C216-4EDA-8852-0A6BD4C275B0@amado-alves.info> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit From: Marius Amado-Alves Subject: Re: How do you bitwise operations in Ada '83 and '95 Date: Wed, 19 Jul 2006 23:30:21 +0100 To: comp.lang.ada@ada-france.org X-Mailer: Apple Mail (2.752.2) X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - zaphen.serversonline.net X-AntiAbuse: Original Domain - ada-france.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - amado-alves.info X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: amavisd-new at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.8rc1 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.ada Message-ID: X-Leafnode-NNTP-Posting-Host: 88.191.17.134 Organization: Guest of ProXad - France NNTP-Posting-Date: 20 Jul 2006 00:34:02 MEST NNTP-Posting-Host: 88.191.14.223 X-Trace: 1153348442 nnrp10-1.free.fr 23603 88.191.14.223:36029 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:5826 Date: 2006-07-20T00:34:02+02:00 >> Jeff, my intent was to investigate and develop a working Ada library >> corresponding to the C source code bitwise operators: "&", "|", "<<", >> ">>", etc. > > I trust you now understand that such a library is unnecessary. Indeed. Incidentally I have just finished a small package that shows well how to do bitwise operations in Ada. Package Calendar_64 represents dates in a 64-bit string divided into several parts for year, month, etc. The whole package, including a test program and documentation is available at softdevelcoop.org (in Works / Software) Note that I don't do bit shifting. Instead I multiply or divide by a magnitude. I don't think bit shifting is portable.