comp.lang.ada
 help / color / mirror / Atom feed
From: david.c.hoos.sr@ada95.com (David C. Hoos)
Subject: Re: Minimum Record Size?  LONG
Date: 25 Apr 2003 20:00:05 -0700
Date: 2003-04-26T03:00:06+00:00	[thread overview]
Message-ID: <c7122dca.0304251900.3baaca57@posting.google.com> (raw)
In-Reply-To: H5iqa.621548$L1.175962@sccrnsc02

<tmoran@acm.org> wrote in message news:H5iqa.621548$L1.175962@sccrnsc02...
> >Here is an approach that, while verbose, is written to be understandable
> >by the reader.
>   If the reader is careful and willing to study a shorter piece of code,
> then, in the spirit of the OP's first try
<snip>
> we can modify the function to:
> >  function Four_Sixes_To_Three_Eights (X : Four_Sixes)
> >    return Three_Eights
> >  is
> >  begin
>      return (1=>  Eight(x(1))*4          + Eight(x(2))/16,
>              2=> (Eight(x(2)) mod 16)*16 + Eight(x(3))/4,
>              3=> (Eight(x(3)) mod 4)*64  + Eight(x(4)));
> >  end Four_Sixes_To_Three_Eights;

Very nice.  I overlooked the fact that arithmetic operations
instead of shifts and masks would take care of the endianness problem
in a very elegant way.



  reply	other threads:[~2003-04-26  3:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-25 16:33 Minimum Record Size? LONG Dr Nancy's Sweetie
2003-04-25 17:35 ` Stephen Leake
2003-04-25 17:36 ` Mark Johnson
2003-04-25 21:54   ` tmoran
2003-04-25 18:51 ` David C. Hoos
2003-04-25 21:51   ` tmoran
2003-04-26  3:00     ` David C. Hoos [this message]
2003-04-26  2:12 ` Steve
2003-04-27  1:57   ` Rick Stikkers
2003-04-27 12:06   ` David C. Hoos
2003-04-27 14:17     ` Steve
2003-04-27 20:25       ` David C. Hoos
2003-04-28  5:04         ` Steve
replies disabled

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