comp.lang.ada
 help / color / mirror / Atom feed
* Conversion problem
@ 1997-07-29  0:00 Christer Frovik
  1997-07-30  0:00 ` Anonymous
  1997-08-01  0:00 ` Paul Van Bellinghen
  0 siblings, 2 replies; 3+ messages in thread
From: Christer Frovik @ 1997-07-29  0:00 UTC (permalink / raw)



Hi.

How do i convert Interfaces.Unsigned_16 to Standard.Integer?

/CF





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Conversion problem
  1997-07-29  0:00 Conversion problem Christer Frovik
@ 1997-07-30  0:00 ` Anonymous
  1997-08-01  0:00 ` Paul Van Bellinghen
  1 sibling, 0 replies; 3+ messages in thread
From: Anonymous @ 1997-07-30  0:00 UTC (permalink / raw)



On Tue, 29 Jul 97 20:57:21 +0100, "Christer Frovik"
<mj14148@janus.swip.net> wrote:

> Hi.
> 
> How do i convert Interfaces.Unsigned_16 to Standard.Integer?
> 
> /CF
> 
> 
> 

U : Interfaces.Unsigned_16 := Some_Value;
I : Integer                := Integer (U);

Jeff Carter  PGP:1024/440FBE21
My real e-mail address: ( carter @ innocon . com )
"We call your door-opening request a silly thing."
Monty Python & the Holy Grail

Posted with Spam Hater - see
http://www.compulink.co.uk/~net-services/spam/




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Conversion problem
  1997-07-29  0:00 Conversion problem Christer Frovik
  1997-07-30  0:00 ` Anonymous
@ 1997-08-01  0:00 ` Paul Van Bellinghen
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Van Bellinghen @ 1997-08-01  0:00 UTC (permalink / raw)




> 
> How do i convert Interfaces.Unsigned_16 to Standard.Integer?
> 
a short (16 bit) unsigned integer is usually defined in the Unsigned_types
package as either range 0 .. 2**16-1 for Ada 83 or mod 2**16 for Ada 95 to
allow wrapping. You can usually just re-cast a variable of type
unsigned_short to integer (integer (unsigned_16_variable)). However, I
don't know how the type you are referring to is defined in your Interfaces
package. You can always use an unsigned_conversion from type unsigned_16 to
integer if you must. 





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-08-01  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-07-29  0:00 Conversion problem Christer Frovik
1997-07-30  0:00 ` Anonymous
1997-08-01  0:00 ` Paul Van Bellinghen

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