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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Binary and XML serialization of types Date: Tue, 4 Feb 2014 12:14:47 +0100 Organization: cbb software GmbH Message-ID: References: <20a36d96-850e-4020-8dfa-777eb9c944f4@googlegroups.com> <9e27abb7-e944-4bd4-a10c-600fe4da7872@googlegroups.com> <56a5aeb6-8704-457c-a24f-b664746afe72@googlegroups.com> <13pvagjpwejni$.1e8ll5btxg1f5$.dlg@40tude.net> <5bf8c737-b99d-4069-885f-03fe82f06cc6@googlegroups.com> <14k7gbu5ws82b.3pn20kh5ci50.dlg@40tude.net> <1txs6yifzioke$.30cghpl6qq1j$.dlg@40tude.net> <18q1ats1rko50$.zp43ryd37uis.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: I5Na6+WsEzT8WoegI0VZTA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:18368 Date: 2014-02-04T12:14:47+01:00 List-Id: On Tue, 4 Feb 2014 02:33:49 -0800 (PST), AdaMagica wrote: >> P.S. I cannot find a reference in RM which states the semantics of >> >> Shift_Left. I presume that it is such that >> >> Shift_Left (2#0001#, 1) = 2#0010# >> > B.2(9) should be clear enough, especially when you take into account the > last sentence about tight shift: > > For each such modular type in Interfaces, shifting and rotating > subprograms as specified in the declaration of Interfaces above. These > subprograms are Intrinsic. They operate on a bit-by-bit basis, using the > binary representation of the value of the operands to yield a binary > representation for the result. The Amount parameter gives the number of > bits by which to shift or rotate. For shifting, zero bits are shifted in, > except in the case of Shift_Right_Arithmetic, where one bits are shifted > in if Value is at least half the modulus. > > (Note that more significant bits in any scalar value independently of its > length are always left from less significant ones, independently whether > you count bits from left to right (BE) or rigth to left (LE).) Yes, if "binary representation of the value" taken in its mathematical sense. Yet in the same sentence with "bit-by-bit basis" it may leave a [false] impression that maybe the representation here is to refer to a representation in the physical memory, which would have a way different meaning then. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de