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-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!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: How do you bitwise operations in Ada '83 and '95 Date: Fri, 21 Jul 2006 20:03:09 +0100 Organization: Pushface Message-ID: References: <9315684D-C216-4EDA-8852-0A6BD4C275B0@amado-alves.info> <1e7szqc5niq0u$.1oqd2mhiiccyx.dlg@40tude.net> <71nkuwdmd7v5.xs4ho9ifpcfx$.dlg@40tude.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1153508587 26172 62.49.19.209 (21 Jul 2006 19:03:07 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 21 Jul 2006 19:03:07 +0000 (UTC) Cancel-Lock: sha1:K8cvreMNsXRizhI96AGU3amjOi8= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:5865 Date: 2006-07-21T20:03:09+01:00 List-Id: "Dmitry A. Kazakov" writes: > It depends on endianness. Provided that storage elements are octets > on both machines, which assumption could be wrong, 128 shifted left > might yield 0, 256 or even 64 (what is "left"?). You might as well argue that the C operator<< could produce 64 or 256. > When considering *any* thinkable architecture, it might be even > impossible to implement Shift_* at all. Let some crazy hardware > store numbers in only odd bits, reserving even ones for something > else (like a check-sum). On such imaginary hardware Shift_Left (*, > 1) wouldn't even yield a valid number! Actually "they operate on a > bit-by-bit basis" is quite hazy. What is bit? Which bits are > adjacent? How are they ordered? What does "left" mean? Which bits > are of the number? etc. One would think the market for hardware like that would be pretty thin; not really a "thinkable" architecture. Certainly not interesting.