From: Martin <martin.dowie@btopenworld.com>
Subject: Re: Conversion from floating point to signed 16 bits
Date: Wed, 20 May 2009 09:13:38 -0700 (PDT)
Date: 2009-05-20T09:13:38-07:00 [thread overview]
Message-ID: <03e3ae12-0691-4b16-8b55-23cace959cc0@n21g2000vba.googlegroups.com> (raw)
In-Reply-To: 57bae2c6-b183-4a69-93ce-82a3d892b9f3@b7g2000pre.googlegroups.com
On May 20, 4:47 pm, Adam Beneschan <a...@irvine.com> wrote:
> On May 20, 8:23 am, Martin <martin.do...@btopenworld.com> wrote:
>
>
>
> > On May 20, 4:18 pm, "Jeffrey R. Carter"
>
> > <spam.jrcarter....@nospam.acm.org> wrote:
> > > Martin wrote:
>
> > > > Or better - just use package Interfaces instead...
>
> > > No. Interfaces.Unsigned_16 is a modular type. The OP's Unsigned_16 is a signed
> > > integer type.
>
> > > --
> > > Jeff Carter
> > > "English bed-wetting types."
> > > Monty Python & the Holy Grail
> > > 15
>
> > So it is!!
>
> > A rather poorly named type then...tricky to think of a better name
> > though - perhaps the Interfaces names should have been Modular_16 /
> > etc. Too late now...back to Int16 and Uint16 it is then...
>
> As Jeff said, the OP's Unsigned_16 is a "signed integer type"
> according to the definitions in the Ada standard, which defines two
> kinds of integer types, "signed" and "modular". There is no
> "unsigned" integer type. However, a type like Unsigned_16 will
> usually be implemented (on an 8-bit-byte-addressable machine) as a 16-
> bit unsigned integer (objects of the type will occupy exactly two
> bytes, and the code will use instructions that operate on 16-bit
> unsigned integers where possible, if such instructions exist). To me,
> that makes it hard to criticize the choice of name---practically
> speaking, it's an unsigned 16-bit integer type in normal industry
> parlance, and we can't expect Ada programmers to know the details of
> the standard's terminology as well as we language lawyers do. As for
> the complaint that the type name be confused with types in
> Interfaces---maybe, maybe not. It depends on who'll be reading the
> code. I don't think we can decree that every name defined by the
> Standard is off-limits for programming use, so we have to draw a line
> somewhere.
>
> -- Adam
Yes, the names in Interfaces do match those used by the C-style of
languages but it's a shame that because those other languages don't
have the rich variety that Ada does that we end up with a bit of a
mismatch.
I'm so used to Unsigned_16/etc being modular that whenever I see them
that's what I expect.
Cheers
-- Martin
prev parent reply other threads:[~2009-05-20 16:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-19 18:51 Conversion from floating point to signed 16 bits Olivier Scalbert
2009-05-19 19:37 ` Adam Beneschan
2009-05-19 19:57 ` Jeffrey R. Carter
2009-05-19 22:36 ` Adam Beneschan
2009-05-19 19:55 ` Jeffrey R. Carter
2009-05-19 20:06 ` Ludovic Brenta
2009-05-19 22:08 ` Olivier Scalbert
2009-05-20 8:29 ` Stuart
2009-05-20 8:48 ` Stuart
2009-05-20 11:11 ` Georg Bauhaus
2009-05-20 12:06 ` Martin
2009-05-20 15:18 ` Jeffrey R. Carter
2009-05-20 15:23 ` Martin
2009-05-20 15:47 ` Adam Beneschan
2009-05-20 16:13 ` Martin [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox