From: Martin <martin.dowie@btopenworld.com>
Subject: Re: Conversion from floating point to signed 16 bits
Date: Wed, 20 May 2009 05:06:31 -0700 (PDT)
Date: 2009-05-20T05:06:31-07:00 [thread overview]
Message-ID: <e48e0407-a697-4832-b95e-e7391a0ec760@g20g2000vba.googlegroups.com> (raw)
In-Reply-To: 4a13e54a$0$32672$9b4e6d93@newsspool2.arcor-online.net
On May 20, 12:11 pm, Georg Bauhaus <rm.dash-bauh...@futureapps.de>
wrote:
> Olivier Scalbert schrieb:
>
> > Hello,
>
> > My problem:
> > I need to convert an "analogic" value which can vary from 0.0 to 1.0
> > into a "discrete" value which is a signed 16 bits integer.
>
> > My implementation:
> > -----------------------------
> > with Ada.Text_IO;
>
> > procedure convert is
> > type Analog_Value is digits 10 range 0.0 .. 1.0;
> > type Signed_16 is range -32768 .. 32767;
> > type Unsigned_16 is range 0 .. 65535;
>
> It might be an idea to use a different name
> for Unsigned_16 because this name is also
> declared in standard package Interfaces.
> Or use qualification. Avoids misunderstandings.
Or better - just use package Interfaces instead...
Cheers
-- Martin
next prev parent reply other threads:[~2009-05-20 12:06 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 [this message]
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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox