comp.lang.ada
 help / color / mirror / Atom feed
From: robert_dewar@my-dejanews.com
Subject: Re: how to do bit-wise operation on none modular types?
Date: 1999/03/04
Date: 1999-03-04T00:00:00+00:00	[thread overview]
Message-ID: <7bkr0s$a7s$1@nnrp1.dejanews.com> (raw)
In-Reply-To: F81LB1.L19.0.-s@inmet.camb.inmet.com

In article <F81LB1.L19.0.-s@inmet.camb.inmet.com>,
  stt@houdini.camb.inmet.com (Tucker Taft) wrote:
> Samuel Mize (smize@imagin.net) wrote:
>
> Personally, I find "X mod 16#10000#" *more* clear than "X
> and 16#FFFF#" because bitwise "and" is working on the
> representation, whereas "mod" is working on the value,
> but vive la difference.

I could not begin to choose between these two without
knowing what the data in question represents. If it is
indeed logically an integer, then the first form is better,
but if in fact the integer is really a string of bits, then
the AND is clearer. Yes, you may say that the string of
bits would better be represented as a packed boolean array,
but if you are interfacing to some foreign environment
which thinks of it as an integer, it is actually safer to
map it into an integer. The trouble with the packed boolean
array is that you do NOT know the mapping of subscripts in
the array to bit positions in the integer.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  parent reply	other threads:[~1999-03-04  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-03  0:00 how to do bit-wise operation on none modular types? bill
1999-03-03  0:00 ` Tarjei Tj�stheim Jensen
1999-03-03  0:00 ` Tucker Taft
1999-03-03  0:00   ` Samuel Mize
1999-03-03  0:00     ` Tucker Taft
1999-03-04  0:00       ` Tom Moran
1999-03-04  0:00         ` fraser
1999-03-04  0:00       ` robert_dewar [this message]
1999-03-05  0:00         ` bourguet
1999-03-05  0:00           ` robert_dewar
1999-03-03  0:00     ` fraser
1999-03-04  0:00       ` Samuel Mize
1999-03-05  0:00         ` fraser
1999-03-04  0:00       ` dennison
1999-03-03  0:00     ` dennison
replies disabled

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