comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Type conversion / computing problem
Date: 2000/02/17
Date: 2000-02-17T00:00:00+00:00	[thread overview]
Message-ID: <wccemabg2j1.fsf@world.std.com> (raw)
In-Reply-To: 38AC2367.F60CA114@gmx.net

Andreas <Amun_Ra72@gmx.net> writes:

> Now, the problem is that these functions work perfectly only for positive 
> Integers (I guess because of the unsigned Byte), not for negative values.

You could convert each signed integer to a modular of the same size
using Unchecked_Conversion.  And I think your code already knows how to
convert that to an array-of-8-bytes, with the right byte ordering.

Or, unchecked conv signed to modular of same size, then use a normal
type_conversion to convert to a "mod 2**64" type, then unchecked convert
that to array-of-8-bytes, then apply a byte-swap procedure to that
array.

- Bob




  reply	other threads:[~2000-02-17  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-17  0:00 Type conversion / computing problem Andreas
2000-02-17  0:00 ` Robert A Duff [this message]
2000-02-22  0:00   ` Oliver Kellogg
  -- strict thread matches above, loose matches on Subject: below --
2000-02-17  0:00 Andreas
replies disabled

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