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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!enea!sommar From: sommar@enea.UUCP (Erland Sommarskog) Newsgroups: net.lang.ada Subject: AND, OR & XOR on integers Message-ID: <1255@enea.UUCP> Date: Sun, 23-Mar-86 11:12:13 EST Article-I.D.: enea.1255 Posted: Sun Mar 23 11:12:13 1986 Date-Received: Tue, 25-Mar-86 05:25:53 EST References: <306@telesoft.UKE> <4700020@ada-uts> Reply-To: sommar@enea.UUCP (Erland Sommarskog) Distribution: net Organization: Enea Data, Sweden List-Id: 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