comp.lang.ada
 help / color / mirror / Atom feed
From: "Paul Van Bellinghen" <pvanbell@mhv.net>
Subject: Re: Conversion problem
Date: 1997/08/01
Date: 1997-08-01T00:33:35+00:00	[thread overview]
Message-ID: <01bc9e12$7288d020$17a9f5cd@asip120> (raw)
In-Reply-To: 85344.mj14148@janus.swip.net



> 
> 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. 





      parent reply	other threads:[~1997-08-01  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-29  0:00 Conversion problem Christer Frovik
1997-07-30  0:00 ` Anonymous
1997-08-01  0:00 ` Paul Van Bellinghen [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