comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@nospam.acm.org>
Subject: Re: Conversion from floating point to signed 16 bits
Date: Tue, 19 May 2009 19:57:16 GMT
Date: 2009-05-19T19:57:16+00:00	[thread overview]
Message-ID: <waEQl.108876$DP1.101635@attbi_s22> (raw)
In-Reply-To: <5d240393-452e-46d8-bc55-e46901bb1d6f@d19g2000prh.googlegroups.com>

Adam Beneschan wrote:
> 
> If your problem is that you're getting a Constraint_Error when the
> subtraction "U16 - 32768" has a negative result, you can convert U16
> to some larger integer type before doing the subtraction:

That wouldn't happen as written because the subtraction would use the base type, 
which is symmetrical (more or less) around zero.

-- 
Jeff Carter
"Pray that there's intelligent life somewhere up in
space, 'cause there's bugger all down here on earth."
Monty Python's Meaning of Life
61



  reply	other threads:[~2009-05-19 19:57 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 [this message]
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
replies disabled

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