Re: How do you bitwise operations in Ada '83 and '95
- From: "Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx>
- Date: Sat, 22 Jul 2006 15:31:51 +0200
On Sat, 22 Jul 2006 12:52:29 +0200, Georg Bauhaus wrote:
On Sat, 2006-07-22 at 10:32 +0200, Dmitry A. Kazakov wrote:
Does ANSI C standard require (x<<1) == (x*2)?
As for Ada 95, ARM certainly does not. This is why Shift_* is not portable.
type Unsigned_n is mod 2**n; -- Annex B.2
won't be portable for the same reason?
Why? Semantics of modular arithmetic is defined in a portable way. As long
as you deal with *numbers* everything is OK.
As for the bit representation of these intrinsic modular values,
wouldn't shift_left etc. have to provide a result that does
make sense, as per the AS-IF rule?
I am not a language lawyer. To me shifts aren't numeric operations, but
ones on arrays of bits. Mixing both is asking for trouble.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.
- References:
- Re: How do you bitwise operations in Ada '83 and '95
- From: Marius Amado-Alves
- Re: How do you bitwise operations in Ada '83 and '95
- From: Simon Wright
- Re: How do you bitwise operations in Ada '83 and '95
- From: Dmitry A. Kazakov
- Re: How do you bitwise operations in Ada '83 and '95
- From: Georg Bauhaus
- Re: How do you bitwise operations in Ada '83 and '95
- Prev by Date: Re: How do you bitwise operations in Ada '83 and '95
- Next by Date: Re: Answer of Request to AdaCore on licensing Status of GtkAda 2.4.0
- Previous by thread: Re: How do you bitwise operations in Ada '83 and '95
- Next by thread: Fwd: How do you bitwise operations in Ada '83 and '95
- Index(es):
Relevant Pages
|