home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
- From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
- Newsgroups: comp.lang.c
- Subject: Re: Sets in C
- Message-ID: <1992Sep11.203936.15198@klaava.Helsinki.FI>
- Date: 11 Sep 92 20:39:36 GMT
- References: <14390@goanna.cs.rmit.oz.au> <kjb.716185475@godzilla.cgl.citri.edu.au> <1992Sep11.132212.1489@klaava.Helsinki.FI>
- Organization: University of Helsinki
- Lines: 14
-
- wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
- > #define ELEMBIT(n) ((n) % INT_BITS)
- > set[INDEX(elementnumber)] |= ELEMBIT(elementnumber)
-
- It was pointed out to me in e-mail that the above line is, of course,
- incorrect. You need to change it to
-
- set[INDEX(elementnumber)] |= 1 << ELEMBIT(elementnumber)
-
- Also, the method I outlined works, but the code should not be taken as a
- guideline, only as a demonstration of the principle.
-
- --
- Lars.Wirzenius@helsinki.fi
-