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,bd45e29f9dafca87 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: bitwise comparators Date: 2000/01/16 Message-ID: <5j9g4.1718$%Y3.105022@newsread2.prod.itd.earthlink.net>#1/1 X-Deja-AN: 573184896 Content-transfer-encoding: 7bit References: <3880D375.7E363123@hotmail.com> Content-Type: text/plain; charset="US-ASCII" X-ELN-Date: Sat Jan 15 17:39:13 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 947986753 38.26.192.12 (Sat, 15 Jan 2000 17:39:13 PST) Organization: EarthLink Network, Inc. Mime-version: 1.0 NNTP-Posting-Date: Sat, 15 Jan 2000 17:39:13 PST Newsgroups: comp.lang.ada Date: 2000-01-16T00:00:00+00:00 List-Id: In article <3880D375.7E363123@hotmail.com> , Alexander Van Hecke wrote: > I want to do the following : > OK_to_proceed : BOOLEAN := FALSE; > data : Unsigned_8; > > while (not OK_to_proceed) loop > -- do stuff > OK_to_proceed := (data BITWISE AND 2#1#); > end loop; > > so I want to exit the loop if bit one of data is set, but I don't know > what the bitwise and is! The bitwise and for modular types is "and". Don't use the while form of loop; your version requires mental gymnastics to figure out. If you want to "exit the loop if bit one of data is set," then say that directly: loop -- do stuff exit when (data and 2#1#) > 0; end loop; You also have to be careful what you mean by "bit one". Are you referring to the bit that corresponds to the value of 2**0, or 2**1? Your original example uses 2#1#, which I would probably describe as the "bit zero." -- Time and again the nation's courts have ruled that creationism, as a religious dogma, cannot be taught in science classes. Now, creationists are advancing a new tactic: eliminating the teaching of evolution and other sciences that complement evolution, such as geology, paleontology, and biological anthropology. By doing so, they are not only endangering church-state separation but also seriously jeopardizing the science education of future generations. http://www.campusfreethought.org/sos/