home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!Germany.EU.net!ira.uka.de!news.belwue.de!news.uni-stuttgart.de!pc8.izfm.uni-stuttgart.de!uli
- From: uli@izfm.uni-stuttgart.de (Uli Allgeier)
- Newsgroups: comp.lang.pascal
- Subject: Re: help ??
- Date: 22 Jan 1993 16:40:47 GMT
- Organization: IZFM, University of Stuttgart
- Lines: 34
- Message-ID: <uli.59.0@izfm.uni-stuttgart.de>
- References: <8269@kielo.uta.fi>
- NNTP-Posting-Host: pc8.izfm.uni-stuttgart.de
-
- Hi!
-
- In article <8269@kielo.uta.fi> csfraw@vehka.cs.uta.fi (Francis Akoto) writes:
- >Can somebody please explain the code below
- >
- >( i.e can you write it in another way )
- >
- >-----
- >vi: integer ;
- >
- > if ( vi and 1) = 1 then
- > vi := vi shr 1;
- > ...............
- > ...............
- >
- >
- >for example : what happens if vi= 1 or vi = 2 etc will the if statment be true
- >and what is "shr".
-
- In Turbo-Pacasl 3.0 'and' does a bit-by-bit logical and.
- example:
- 0 and 0 is 0
- 1 and 0 is 0
- 1 and 1 is 1
- 1 and 2 is 1
- 1 and 3 is 1
- 2 and 1 is 0
- 3 and 1 is 1
- 6 and 3 is 2
- and so on.
-
- Cheers
-
- Uli
-