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,ee7e80feb46de7ac X-Google-Attributes: gid103376,public From: mfb@mbunix.mitre.org (Michael F Brenner) Subject: Re: How to perform bit-wise xor, and...? Date: 1996/11/24 Message-ID: <579n3q$r99@top.mitre.org>#1/1 X-Deja-AN: 198440395 distribution: inet references: <5747oa$svi@umacss1.umac.mo> <1996Nov22.105049.1@eisner> organization: The MITRE Corporation, Bedford Mass. newsgroups: comp.lang.ada Date: 1996-11-24T00:00:00+00:00 List-Id: Larry said: > ... let me just comment that when you declare something as an > integer it specifies the manner in which you intend to use it. > If you find you have a need to apply logical operations to a numeric, > then either: > 1) You were wrong to declare it as an integer >or > 2) Some external definition has horribly overloaded the > meaning of a given location* I would like to add a third possibility: 3) There is nothing wrong with using XOR or other operators on exact numbers, and Ada has been upgraded to Ada-95 which allows those operators on a kind of exact number known as modular types. Ada-83 permitted these operators by means of library packages, but these operators were not built into the language for exact types. To use the Ada-95 operators, download or purchase an Ada-95 compiler, and declare your variables of a type like this: type exacts is mod 2**8;