comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <martin@krischik.com>
Subject: Re: Signed vs Natural/32-bits vs 31 bits
Date: Thu, 28 Oct 2004 09:53:28 +0200
Date: 2004-10-28T09:53:28+02:00	[thread overview]
Message-ID: <3180772.TNT8d03Rs9@linux1.krischik.com> (raw)
In-Reply-To: 35f054ea.0410270735.7892ff30@posting.google.com

skidmarks wrote:

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

No. But the solution is clear:

type Natural is new Standart.Natural;
for Natural'Size use 32;

or

X : Natural := 0;
for X'Size use 32;

And you have 2 32 bit types. If you don't like confusion people then you can
use My_Natural as identifier ;-).

With Regards

Martin
-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com



  parent reply	other threads:[~2004-10-28  7:53 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
2004-10-28  7:53     ` Martin Krischik [this message]
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