From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,937e32e44ab82465 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Type conversion / computing problem Date: 2000/02/17 Message-ID: #1/1 X-Deja-AN: 586996030 Sender: bobduff@world.std.com (Robert A Duff) References: <38AC2367.F60CA114@gmx.net> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-02-17T00:00:00+00:00 List-Id: Andreas 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