Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!ll-xn!mit-eddie!bu-cs!purdue!decwrl!labrea!agate!ucbvax!WYOCDC1.BITNET!ZSYJKAA From: ZSYJKAA@WYOCDC1.BITNET (Jim Kirkpatrick 307 766-5303) Newsgroups: comp.os.vms Subject: COMPUTING PARITY Message-ID: <880517130505.00000743.BAQK.83@WYOCDC1> Date: 17 May 88 19:05:05 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 11 Is there any quick method in VMS fortran to compute the parity of a 32-bit word? Either a function that does exactly that, or one that returns the number of "1" bits in the word? By analogy, if you're familiar with Control Data Cybers, there's the POP instruction (POPulation count) which returns the number of "1" bits; checking the low bit of the count tells you if the word has even or odd parity. CDC Fortran has a corresponding intrinsic function. The best I can think of in VMS is to loop 32 times and use ISHFT and IAND. Jim Kirkpatrick ZSYJKAA@WYOCDC1 (on BITNET) "help stamp out 5-page signature files"