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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: marcoschmidt@geocities.com (Marco Schmidt) Subject: Re: Beginner's questions Date: 1999/05/03 Message-ID: <372e96bd.6020927@news.rwth-aachen.de>#1/1 X-Deja-AN: 473474140 Content-Transfer-Encoding: 7bit References: <372da49c.12366381@news.rwth-aachen.de> Content-Type: text/plain; charset=us-ascii Organization: - Mime-Version: 1.0 Reply-To: marcoschmidt@geocities.com Newsgroups: comp.lang.ada Date: 1999-05-03T00:00:00+00:00 List-Id: On Sun, 02 May 1999 19:15:01 GMT, Matthew Heaney wrote: Thanks for your answer. >> 1) I couldn't find out how to use bitwise operations "and" and "or" >> (which would be "and" / "or" in Pascal and "&" / "|" in C). Do I have >> to include a certain package? > >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 want to fill an array of 64 Integer values with the number of "on" bits in the numbers 0 to 63, so the resulting array should look like this: index : value ------------- 0 : 0 1 : 1 2 : 1 3 : 2 4 : 1 5 : 2 and so on. It's a lookup table I want to use in another part of the program. 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. Regards, Marco