From: sommar@enea.UUCP (Erland Sommarskog)
Subject: AND, OR & XOR on integers
Date: Sun, 23-Mar-86 11:12:13 EST [thread overview]
Date: Sun Mar 23 11:12:13 1986
Message-ID: <1255@enea.UUCP> (raw)
In-Reply-To: 4700020@ada-uts
In article <4700020@ada-uts> stt@ada-uts.UUCP writes:
>
>AND, OR, and XOR are defined on boolean arrays (whether packed or not).
>If you have a great desire to apply these operators to Integers,
>then you will have to implement them via pragma-Interfaced functions (in C
>or assembler), or hope that your compiler supports packed boolean arrays
>and Unchecked_Conversion between Integers and appropriately-long
>packed, constrained, boolean arrays.
NO, NO, NO! The author of this doesn't seem very knowledgeable in Ada. What
you do if you need logical operators on integers is of course:
FUNCTION "XOR"( IN Number : integer) RETURN boolean_value;
And to implement this functions is not very hard, unless you don't want
go as fast as an assembler instruction.
Erland Sommarskog
next prev parent reply other threads:[~1986-03-23 16:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <306@telesoft.UKE>
1986-03-18 16:55 ` Orphaned Response stt
1986-03-23 16:12 ` Erland Sommarskog [this message]
1986-03-31 14:34 ` AND, OR & XOR on integers stt
1986-04-14 23:48 ` David desJardins
1986-04-17 2:09 ` Dik T. Winter
1986-04-17 2:20 ` Dik T. Winter
1986-03-25 16:20 Doug Bryan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox