home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdarg.h>
- #include "sets.h"
- /***************************************************************************/
- unsigned wordlength(void)
- /***************************************************************************/
- /* This determines the number of bits in a standard unsigned integer. */
- {
- unsigned x,y; /* this is standard word length */
-
- x = y = 0; /* zero all bits */
-
- x = ~x; /* set all bits to '1' */
-
- do {
- x = x << 1; /* shift all bits 1 place to left; fill LSB with '0' */
- y++; /* count the number of shifts */
- } while(x != 0); /* when x == 0, all bits have been shifted out */
-
- return y; /* y == number of bits in word */
-
- } /* end wordlength */
-
-