comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos" <david.c.hoos.sr@ada95.com>
To: "skidmarks" <aschwarz@acm.org>
Cc: "comp.lang.ada@ada.eu.org" <comp.lang.ada@ada-france.org>
Subject: Re: Signed vs Natural/32-bits vs 31 bits
Date: Wed, 27 Oct 2004 11:25:14 -0500
Date: 2004-10-27T11:25:14-05:00	[thread overview]
Message-ID: <mailman.62.1098894394.10401.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: 35f054ea.0410270735.7892ff30@posting.google.com

Unchecked_Conversion only copies bits without any interpretation
or movement of bits.  When the two objects are of different sizes,
only the bits in the source object are copied.

For full details see RM95 13.9(1-5).

If you want a 32-bit natural number, you need to declare an object
of (say) type Interfaces.Unsigned_32;

Then, instead of using an instance of Unchecked_Conversion,
you do an explicit type conversion as described in  RM95 4.6

----- Original Message ----- 
From: "skidmarks" <aschwarz@acm.org>
Newsgroups: comp.lang.ada
To: <    >
Sent: Wednesday, October 27, 2004 10:35 AM
Subject: Re: Signed vs Natural/32-bits vs 31 bits


> David Hoos in a private communication indicated that the least
> significant bit was (indeed) deleted. What is confusing about this
> dialog is that I thought that 'Unchecked_Conversion' meant that all
> bits were used and the bits were converted to the 'new' type. Under
> this impression, my thought was that I'd have a 32-bit Natural number.
> What I seem to be told is that that is not accurate and that
> 'Unchecked_Conversion' takes less liberties than I'd hoped. Any idea
> why?
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada-france.org
> http://www.ada-france.org/mailman/listinfo/comp.lang.ada
> 



  reply	other threads:[~2004-10-27 16:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-25 15:43 Signed vs Natural/32-bits vs 31 bits skidmarks
2004-10-25 19:57 ` Mark H Johnson
2004-10-25 22:40 ` Jeffrey Carter
2004-10-27 15:35   ` skidmarks
2004-10-27 16:25     ` David C. Hoos [this message]
2004-10-28  7:53     ` Martin Krischik
2004-10-29 17:14       ` skidmarks
replies disabled

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