comp.lang.ada
 help / color / mirror / Atom feed
From: Marius Amado-Alves <marius@amado-alves.info>
To: comp.lang.ada@ada-france.org
Subject: Fwd: How do you bitwise operations in Ada '83 and '95
Date: Thu, 20 Jul 2006 10:39:11 +0100
Date: 2006-07-20T11:50:13+02:00	[thread overview]
Message-ID: <mailman.37.1153388851.30988.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: 8B57A49E-38E9-44DC-9B4A-A3F69E058A97@amado-alves.info

>> Note that I don't do bit shifting. Instead I multiply or divide by a
>> magnitude. I don't think bit shifting is portable.
>
> Why should language defined Interfaces.Shift_Right,
> Interfaces.Shift_Right_Arithmetic, Rotate etc. be any less
> portable than language defined arithmetic, as implemented
> by the same compiler

By the same compiler on the same platform yes. For data passed  
between different systems, possibly compiled with different  
compilers, I am not sure. I am not an expert on this part of the RM.  
To me bit shifting is a positional thing. Surely positions differ  
across systems. So I programmed defensively. (In fact I think my  
program would work on a platform of any numerical base, not just  
binary, although this is academic I guess.)




       reply	other threads:[~2006-07-20  9:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8B57A49E-38E9-44DC-9B4A-A3F69E058A97@amado-alves.info>
2006-07-20  9:39 ` Marius Amado-Alves [this message]
2006-07-20 17:54   ` Fwd: How do you bitwise operations in Ada '83 and '95 tmoran
2006-07-20 18:30     ` Marius Amado-Alves
2006-07-20 19:36       ` tmoran
2006-07-20 22:09         ` Simon Wright
2006-07-21 10:07           ` Stephen Leake
2006-07-21 19:09             ` Simon Wright
2006-07-21 19:45               ` tmoran
2006-07-23 15:59               ` Stephen Leake
2006-07-24  6:08                 ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox