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,ccb8bd6b4c3162fd X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Beginner's questions Date: 1999/05/03 Message-ID: #1/1 X-Deja-AN: 473564122 References: <372da49c.12366381@news.rwth-aachen.de> <372e96bd.6020927@news.rwth-aachen.de> NNTP-Posting-Date: Mon, 03 May 1999 09:58:06 PDT Newsgroups: comp.lang.ada Date: 1999-05-03T00:00:00+00:00 List-Id: marcoschmidt@geocities.com (Marco Schmidt) writes: > >Those operations predefined for all modular types. Were you using an > >integer type? > > Yes, but I want to use "and" and "or" for bitwise manipulation, not > logical operations which evaluate to boolean. I don't understand this answer. "and", "or", "xor", and "not" for a modular type are bitwise operators that return a modular value, not Boolean. "and" and "or" aren't defined for (signed) integer types. What kind of type type were you using? Why isn't a modular type adequate? > In Pascal, logical and bitwise operators have the same name (and / > or), while there are different operators in C, C++ and Java (& and &&, > | and ||). I need the & and | version. Signed integer types in Ada95 have neither logical nor bitwise operators. Modular (unsigned) types in Ada95 have bitwise operators "and" and "or". They are not logical operators. There is a way to define bitwise operators for a signed integer type, but it's not going to be as efficient as using an unsigned type.